E5XML/PluginRepositoryReader.py

changeset 582
6b19bd357000
parent 580
45c38566b001
child 589
a9a4620f6767
equal deleted inserted replaced
581:a43695c8b8da 582:6b19bd357000
41 pluginRepositoryFileFormatVersion) 41 pluginRepositoryFileFormatVersion)
42 elif self.name() == "RepositoryUrl": 42 elif self.name() == "RepositoryUrl":
43 url = self.readElementText() 43 url = self.readElementText()
44 Preferences.setUI("PluginRepositoryUrl5", url) 44 Preferences.setUI("PluginRepositoryUrl5", url)
45 elif self.name() == "Plugin": 45 elif self.name() == "Plugin":
46 info = {"name" : "", 46 self.__readPlugin()
47 "short" : "",
48 "description" : "",
49 "url" : "",
50 "author" : "",
51 "version" : "",
52 "filename" : "",
53 }
54 info["status"] = self.attribute("status", "unknown")
55 self.__readPlugin(info)
56 self.dlg.addEntry(info["name"], info["short"],
57 info["description"], info["url"],
58 info["author"], info["version"],
59 info["filename"], info["status"])
60 47
61 self.showErrorMessage() 48 self.showErrorMessage()
62 49
63 def __readPlugin(self, pluginInfo): 50 def __readPlugin(self):
64 """ 51 """
65 Private method to read the plug-in info. 52 Private method to read the plug-in info.
53 """
54 pluginInfo = {"name" : "",
55 "short" : "",
56 "description" : "",
57 "url" : "",
58 "author" : "",
59 "version" : "",
60 "filename" : "",
61 }
62 pluginInfo["status"] = self.attribute("status", "unknown")
66 63
67 @param pluginInfo reference to the dictionary to hold the result
68 @return reference to the populated dictionary
69 """
70 while not self.atEnd(): 64 while not self.atEnd():
71 self.readNext() 65 self.readNext()
72 if self.isEndElement() and self.name() == "Plugin": 66 if self.isEndElement() and self.name() == "Plugin":
73 return pluginInfo 67 self.dlg.addEntry(pluginInfo["name"], pluginInfo["short"],
68 pluginInfo["description"], pluginInfo["url"],
69 pluginInfo["author"], pluginInfo["version"],
70 pluginInfo["filename"], pluginInfo["status"])
71 break
74 72
75 if self.isStartElement(): 73 if self.isStartElement():
76 if self.name() == "Name": 74 if self.name() == "Name":
77 pluginInfo["name"] = self.readElementText() 75 pluginInfo["name"] = self.readElementText()
78 elif self.name() == "Short": 76 elif self.name() == "Short":

eric ide

mercurial