E5XML/SpellCheckDictionariesReader.py

changeset 5870
82e04c70f969
parent 5868
c1a98c164cd3
child 5873
331a5ece2c32
diff -r 70709a460358 -r 82e04c70f969 E5XML/SpellCheckDictionariesReader.py
--- a/E5XML/SpellCheckDictionariesReader.py	Sun Sep 03 12:22:51 2017 +0200
+++ b/E5XML/SpellCheckDictionariesReader.py	Sun Sep 03 17:08:26 2017 +0200
@@ -34,6 +34,7 @@
         self.__entryCallback = entryCallback
         
         self.version = ""
+        self.baseUrl = ""
     
     def readXML(self):
         """
@@ -46,6 +47,7 @@
                     self.version = self.attribute(
                         "version",
                         dictionariesListFileFormatVersion)
+                    self.baseUrl = self.attribute("baseurl", "")
                     if self.version not in self.supportedVersions:
                         self.raiseUnsupportedFormatVersion(self.version)
                 elif self.name() == "DictionariesUrl":
@@ -63,14 +65,18 @@
         Private method to read the plug-in info.
         """
         dictionaryInfo = {"short": "",
-                      "filename": "",
-                      }
+                          "filename": "",
+                          "documentation": "",
+                          "locales": [],
+                          }
         
         while not self.atEnd():
             self.readNext()
             if self.isEndElement() and self.name() == "Dictionary":
                 self.__entryCallback(
-                    dictionaryInfo["short"], dictionaryInfo["filename"])
+                    dictionaryInfo["short"], dictionaryInfo["filename"],
+                    self.baseUrl + dictionaryInfo["filename"],
+                    dictionaryInfo["documentation"], dictionaryInfo["locales"])
                 break
             
             if self.isStartElement():
@@ -78,5 +84,9 @@
                     dictionaryInfo["short"] = self.readElementText()
                 elif self.name() == "Filename":
                     dictionaryInfo["filename"] = self.readElementText()
+                elif self.name() == "Documentation":
+                    dictionaryInfo["documentation"] = self.readElementText()
+                elif self.name() == "Locales":
+                    dictionaryInfo["locales"] = self.readElementText().split()
                 else:
                     self.raiseUnexpectedStartTag(self.name())

eric ide

mercurial