22 |
22 |
23 def __init__(self, device, entryCallback): |
23 def __init__(self, device, entryCallback): |
24 """ |
24 """ |
25 Constructor |
25 Constructor |
26 |
26 |
27 @param device reference to the I/O device to read from (QIODevice) |
27 @param device reference to the I/O device to read from |
|
28 @type QIODevice |
28 @param entryCallback reference to a function to be called once the |
29 @param entryCallback reference to a function to be called once the |
29 data for a plug-in has been read (function) |
30 data for a plug-in has been read |
|
31 @type function |
30 """ |
32 """ |
31 XMLStreamReaderBase.__init__(self, device) |
33 XMLStreamReaderBase.__init__(self, device) |
32 |
34 |
33 self.__entryCallback = entryCallback |
35 self.__entryCallback = entryCallback |
34 |
36 |
68 "url": "", |
70 "url": "", |
69 "author": "", |
71 "author": "", |
70 "version": "", |
72 "version": "", |
71 "filename": "", |
73 "filename": "", |
72 "status": self.attribute("status", "unknown"), |
74 "status": self.attribute("status", "unknown"), |
|
75 "category": self.attribute("category", "not categorized") |
73 } |
76 } |
74 |
77 |
75 while not self.atEnd(): |
78 while not self.atEnd(): |
76 self.readNext() |
79 self.readNext() |
77 if self.isEndElement() and self.name() == "Plugin": |
80 if self.isEndElement() and self.name() == "Plugin": |
82 pluginInfo["url"], |
85 pluginInfo["url"], |
83 pluginInfo["author"], |
86 pluginInfo["author"], |
84 pluginInfo["version"], |
87 pluginInfo["version"], |
85 pluginInfo["filename"], |
88 pluginInfo["filename"], |
86 pluginInfo["status"], |
89 pluginInfo["status"], |
|
90 pluginInfo["category"], |
87 ) |
91 ) |
88 break |
92 break |
89 |
93 |
90 if self.isStartElement(): |
94 if self.isStartElement(): |
91 if self.name() == "Name": |
95 if self.name() == "Name": |