17 |
17 |
18 class MultiProjectReader(XMLStreamReaderBase): |
18 class MultiProjectReader(XMLStreamReaderBase): |
19 """ |
19 """ |
20 Class for reading an XML multi project file. |
20 Class for reading an XML multi project file. |
21 """ |
21 """ |
22 supportedVersions = ["4.2", "5.0"] |
22 supportedVersions = ["4.2", "5.0", "5.1"] |
23 |
23 |
24 def __init__(self, device, multiProject): |
24 def __init__(self, device, multiProject): |
25 """ |
25 """ |
26 Constructor |
26 Constructor |
27 |
27 |
77 Private method to read the project info. |
77 Private method to read the project info. |
78 """ |
78 """ |
79 project = {} |
79 project = {} |
80 |
80 |
81 project["master"] = self.toBool(self.attribute("isMaster", "False")) |
81 project["master"] = self.toBool(self.attribute("isMaster", "False")) |
|
82 uid = self.attribute("uid", "") |
|
83 if uid: |
|
84 project["uid"] = uid |
|
85 else: |
|
86 # upgrade from pre 5.1 format |
|
87 from PyQt4.QtCore import QUuid |
|
88 project["uid"] = QUuid.createUuid().toString() |
82 |
89 |
83 while not self.atEnd(): |
90 while not self.atEnd(): |
84 self.readNext() |
91 self.readNext() |
85 if self.isEndElement() and self.name() == "Project": |
92 if self.isEndElement() and self.name() == "Project": |
86 if 'category' not in project: |
93 if 'category' not in project: |