[gcompris/gcomprixogoo] Fixed a few parsing error in wiktio2wml



commit 42bc606a8e4477f1c3885a6138b0f3a4341ec053
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Sun Sep 19 00:47:50 2010 +0200

    Fixed a few parsing error in wiktio2wml

 tools/wiktio2xml/wiktio2xml.py |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/tools/wiktio2xml/wiktio2xml.py b/tools/wiktio2xml/wiktio2xml.py
index 0474231..7f34155 100755
--- a/tools/wiktio2xml/wiktio2xml.py
+++ b/tools/wiktio2xml/wiktio2xml.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 
 from xml.sax import parse
 from xml.sax.handler import ContentHandler
@@ -39,7 +39,7 @@ class WikiHandler(ContentHandler):
         if name == 'page':
             self.isPageElement= False
             if self.titleContent in self.searchWords:
-                print "<h1>" + self.titleContent + "</h1>"
+                print "<hr></hr><h1>" + self.titleContent + "</h1>"
                 self.parseText()
 
             self.titleContent = ""
@@ -118,14 +118,13 @@ class WikiHandler(ContentHandler):
             return ""
 
         text = self.indents2xml(text)
-
-        text = re.sub(r"{{par ext[^}]+}}", "(Par extension)", text)
-        text = re.sub(r"{{litt[^}]+}}", "(Littéraire)", text)
-        text = re.sub(r"{{figuré[^}]+}}", "(Figuré)", text)
-        text = re.sub(r"{{dés|fr[^}]+}}", "(Désuet)", text)
-        text = re.sub(r"{{vx[^}]+}}", "(Vieilli)", text)
-        text = re.sub(r"{{w\|([^}]+)", "<i>\1</i>", text)
-        text = re.sub(r"{{source\|([^}]+)", "- (\1)", text)
+        text = re.sub(r"{{par ext[^}]+}}", r"(Par extension)", text)
+        text = re.sub(r"{{litt[^}]+}}", r"(Littéraire)", text)
+        text = re.sub(r"{{figuré[^}]+}}", r"(Figuré)", text)
+        text = re.sub(r"{{dés[^}]+}}", r"(Désuet)", text)
+        text = re.sub(r"{{vx[^}]+}}", r"(Vieilli)", text)
+        text = re.sub(r"{{w\|([^}]+)}}", r"<i>\1</i>", text)
+        text = re.sub(r"{{source\|([^}]+)}}", r"- (\1)", text)
 
         # Remove all recognized wiki tags
         text = re.sub(r"{{[^}]+}}", "", text)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]