--- a/src/eric7/EricXML/PluginRepositoryReader.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/EricXML/PluginRepositoryReader.py Wed Jul 13 14:55:47 2022 +0200 @@ -17,22 +17,23 @@ """ Class to read the plug-in repository contents file. """ + supportedVersions = ["4.1", "4.2"] - + def __init__(self, device, entryCallback): """ Constructor - + @param device reference to the I/O device to read from (QIODevice) @param entryCallback reference to a function to be called once the data for a plug-in has been read (function) """ XMLStreamReaderBase.__init__(self, device) - + self.__entryCallback = entryCallback - + self.version = "" - + def readXML(self): """ Public method to read and parse the XML document. @@ -42,8 +43,8 @@ if self.isStartElement(): if self.name() == "Plugins": self.version = self.attribute( - "version", - pluginRepositoryFileFormatVersion) + "version", pluginRepositoryFileFormatVersion + ) if self.version not in self.supportedVersions: self.raiseUnsupportedFormatVersion(self.version) elif self.name() == "RepositoryUrl": @@ -53,33 +54,39 @@ self.__readPlugin() else: self._skipUnknownElement() - + self.showErrorMessage() - + def __readPlugin(self): """ Private method to read the plug-in info. """ - pluginInfo = {"name": "", - "short": "", - "description": "", - "url": "", - "author": "", - "version": "", - "filename": "", - } + pluginInfo = { + "name": "", + "short": "", + "description": "", + "url": "", + "author": "", + "version": "", + "filename": "", + } pluginInfo["status"] = self.attribute("status", "unknown") - + while not self.atEnd(): self.readNext() if self.isEndElement() and self.name() == "Plugin": self.__entryCallback( - pluginInfo["name"], pluginInfo["short"], - pluginInfo["description"], pluginInfo["url"], - pluginInfo["author"], pluginInfo["version"], - pluginInfo["filename"], pluginInfo["status"]) + pluginInfo["name"], + pluginInfo["short"], + pluginInfo["description"], + pluginInfo["url"], + pluginInfo["author"], + pluginInfo["version"], + pluginInfo["filename"], + pluginInfo["status"], + ) break - + if self.isStartElement(): if self.name() == "Name": pluginInfo["name"] = self.readElementText()