E5XML/PluginRepositoryReader.py

changeset 590
beb60b9b3d8d
parent 589
a9a4620f6767
child 791
9ec2ac20e54e
equal deleted inserted replaced
589:a9a4620f6767 590:beb60b9b3d8d
14 14
15 class PluginRepositoryReader(XMLStreamReaderBase): 15 class PluginRepositoryReader(XMLStreamReaderBase):
16 """ 16 """
17 Class to read the plug-in repository contents file. 17 Class to read the plug-in repository contents file.
18 """ 18 """
19 supportedVersions = ["4.1", "4.2"]
20
19 def __init__(self, device, dlg): 21 def __init__(self, device, dlg):
20 """ 22 """
21 Constructor 23 Constructor
22 24
23 @param device reference to the I/O device to read from (QIODevice) 25 @param device reference to the I/O device to read from (QIODevice)
37 self.readNext() 39 self.readNext()
38 if self.isStartElement(): 40 if self.isStartElement():
39 if self.name() == "Plugins": 41 if self.name() == "Plugins":
40 self.version = self.attribute("version", 42 self.version = self.attribute("version",
41 pluginRepositoryFileFormatVersion) 43 pluginRepositoryFileFormatVersion)
44 if self.version not in self.supportedVersions:
45 self.raiseUnsupportedFormatVersion(self.version)
42 elif self.name() == "RepositoryUrl": 46 elif self.name() == "RepositoryUrl":
43 url = self.readElementText() 47 url = self.readElementText()
44 Preferences.setUI("PluginRepositoryUrl5", url) 48 Preferences.setUI("PluginRepositoryUrl5", url)
45 elif self.name() == "Plugin": 49 elif self.name() == "Plugin":
46 self.__readPlugin() 50 self.__readPlugin()

eric ide

mercurial