Changeset 79092 in vbox for trunk/src/VBox/ValidationKit/analysis
- Timestamp:
- Jun 11, 2019 3:26:40 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131252
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/analysis/reader.py
r79087 r79092 31 31 """ 32 32 __version__ = "$Revision$" 33 __all__ = [ 'ParseTestResult', ]33 __all__ = [ 'parseTestResult', ] 34 34 35 35 # Standard python imports. … … 59 59 60 60 def printValue(self, cIndent): 61 print '%sValue: name=%s timestamp=%s unit=%s value="%s"' \62 % (''.ljust(cIndent*2), self.sName, self.sTimestamp, self.sUnit, self.sValue);61 print('%sValue: name=%s timestamp=%s unit=%s value="%s"' 62 % (''.ljust(cIndent*2), self.sName, self.sTimestamp, self.sUnit, self.sValue)); 63 63 64 64 … … 130 130 131 131 def printTree(self, iLevel = 0): 132 print '%sTest: name=%s start=%s end=%s' % (''.ljust(iLevel*2), self.sName, self.sStartTS, self.sEndTS);132 print('%sTest: name=%s start=%s end=%s' % (''.ljust(iLevel*2), self.sName, self.sStartTS, self.sEndTS)); 133 133 for oChild in self.aoChildren: 134 134 oChild.printTree(iLevel + 1); … … 175 175 176 176 # If we have children, they must've matched up. 177 if len(self.aoChildren) != 0:177 if self.aoChildren: 178 178 return True; 179 179 return self.matchFilters(asFilters); 180 180 181 181 def filterTests(self, asFilters): 182 if len(asFilters) > 0:182 if asFilters: 183 183 self.filterTestsWorker(asFilters) 184 184 return self; … … 220 220 def handleElementStart(self, sName, hsAttrs): 221 221 #print '%s%s: %s' % (''.ljust(self.iLevel * 2), sName, str(hsAttrs)); 222 if sName == 'Test' or sName == 'SubTest':222 if sName in ('Test', 'SubTest',): 223 223 self.iLevel += 1; 224 224 self.oTest = self.oTest.addChild(Test(self.oTest, hsAttrs)); … … 236 236 self.handleInclude(hsAttrs); 237 237 else: 238 print 'Unknonwn element "%s"' % (sName);238 print('Unknonwn element "%s"' % (sName,)); 239 239 240 240 def handleElementData(self, sData): … … 242 242 self.oValue.addData(sData); 243 243 elif sData.strip() != '': 244 print 'Unexpected data "%s"' % (sData);244 print('Unexpected data "%s"' % (sData,)); 245 245 return True; 246 246 247 247 def handleElementEnd(self, sName): 248 if sName == 'Test' or sName == 'Subtest':248 if sName in ('Test', 'Subtest',): 249 249 self.iLevel -= 1; 250 250 self.oTest = self.oTest.oParent; … … 262 262 oSub = parseTestResult(sXmlFile); 263 263 if oSub is None: 264 print 'error: failed to parse include "%s"' % (sXmlFile);264 print('error: failed to parse include "%s"' % (sXmlFile,)); 265 265 else: 266 266 # Skip the root and the next level before merging it the subtest and … … 272 272 # test or values. 273 273 oSub2 = oSub; 274 while len(oSub2.aoChildren) == 1 and len(oSub2.aoValues) == 0:274 while len(oSub2.aoChildren) == 1 and not oSub2.aoValues: 275 275 oSub2 = oSub2.aoChildren[0]; 276 if len(oSub2.aoValues) == 0:276 if not oSub2.aoValues: 277 277 oSub2 = oSub; 278 278 self.oTest.mergeInIncludedTest(oSub2);
Note:
See TracChangeset
for help on using the changeset viewer.