Streamlined the plug-in repository reader.

Fri, 10 Sep 2010 12:41:22 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 10 Sep 2010 12:41:22 +0200
changeset 582
6b19bd357000
parent 581
a43695c8b8da
child 583
08bc660d6a15

Streamlined the plug-in repository reader.

E5XML/PluginRepositoryReader.py file | annotate | diff | comparison | revisions
--- a/E5XML/PluginRepositoryReader.py	Fri Sep 10 09:04:45 2010 +0200
+++ b/E5XML/PluginRepositoryReader.py	Fri Sep 10 12:41:22 2010 +0200
@@ -43,34 +43,32 @@
                     url = self.readElementText()
                     Preferences.setUI("PluginRepositoryUrl5", url)
                 elif self.name() == "Plugin":
-                    info = {"name"         : "",
-                            "short"        : "",
-                            "description"  : "",
-                            "url"          : "",
-                            "author"       : "",
-                            "version"      : "", 
-                            "filename"     : "",
-                    }
-                    info["status"] = self.attribute("status", "unknown")
-                    self.__readPlugin(info)
-                    self.dlg.addEntry(info["name"], info["short"], 
-                                      info["description"], info["url"], 
-                                      info["author"], info["version"],
-                                      info["filename"], info["status"])
+                    self.__readPlugin()
         
         self.showErrorMessage()
     
-    def __readPlugin(self, pluginInfo):
+    def __readPlugin(self):
         """
         Private method to read the plug-in info.
+        """
+        pluginInfo = {"name"         : "",
+                      "short"        : "",
+                      "description"  : "",
+                      "url"          : "",
+                      "author"       : "",
+                      "version"      : "", 
+                      "filename"     : "",
+        }
+        pluginInfo["status"] = self.attribute("status", "unknown")
         
-        @param pluginInfo reference to the dictionary to hold the result
-        @return reference to the populated dictionary
-        """
         while not self.atEnd():
             self.readNext()
             if self.isEndElement() and self.name() == "Plugin":
-                return pluginInfo
+                self.dlg.addEntry(pluginInfo["name"], pluginInfo["short"], 
+                                  pluginInfo["description"], pluginInfo["url"], 
+                                  pluginInfo["author"], pluginInfo["version"],
+                                  pluginInfo["filename"], pluginInfo["status"])
+                break
             
             if self.isStartElement():
                 if self.name() == "Name":

eric ide

mercurial