Changeset 56806 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Jul 5, 2015 4:58:12 PM (10 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testmanager/webui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py
r56295 r56806 213 213 sTs = oTsZulu.strftime('%Y-%m-%d %H:%M:%SZ'); 214 214 return unicode(sTs).replace('-', u'\u2011').replace(' ', u'\u00a0'); 215 216 def formatIntervalShort(self, oInterval): 217 """ 218 Formats an interval (db rep) into a short form. 219 """ 220 # default formatting for negative intervals. 221 if oInterval.days < 0: 222 return str(oInterval); 223 224 # Figure the hour, min and sec counts. 225 cHours = oInterval.seconds / 3600; 226 cMinutes = (oInterval.seconds % 3600) / 60; 227 cSeconds = oInterval.seconds - cHours * 3600 - cMinutes * 60; 228 229 # Tailor formatting to the interval length. 230 if oInterval.days > 0: 231 if oInterval.days > 1: 232 return '%d days, %d:%02d:%02d' % (oInterval.days, cHours, cMinutes, cSeconds); 233 return '1 day, %d:%02d:%02d' % (cHours, cMinutes, cSeconds); 234 if cMinutes > 0 or cSeconds >= 30 or cHours > 0: 235 return '%d:%02d:%02d' % (cHours, cMinutes, cSeconds); 236 if cSeconds >= 10: 237 return '%d.%ds' % (cSeconds, oInterval.microseconds / 100000); 238 if cSeconds > 0: 239 return '%d.%02ds' % (cSeconds, oInterval.microseconds / 10000); 240 return '%d ms' % (oInterval.microseconds / 1000,); 215 241 216 242 @staticmethod … … 623 649 elif db.isDbTimestamp(aoValues[i]): 624 650 sRow += webutils.escapeElem(self.formatTsShort(aoValues[i])); 651 elif db.isDbInterval(aoValues[i]): 652 sRow += webutils.escapeElem(self.formatIntervalShort(aoValues[i])); 625 653 elif aoValues[i] is not None: 654 sRow += '<!-- type: %s -->' % (type(aoValues[i]),); ### XXXX 626 655 sRow += webutils.escapeElem(unicode(aoValues[i])); 627 656 -
trunk/src/VBox/ValidationKit/testmanager/webui/wuimain.py
r56765 r56806 793 793 oBuildDataEx = BuildDataEx().initFromDbWithId(self._oDb, oTestSetData.idBuild, oTestSetData.tsCreated); 794 794 try: oBuildValidationKitDataEx = BuildDataEx().initFromDbWithId(self._oDb, oTestSetData.idBuildTestSuite, 795 oTestSetData.tsCreated);795 oTestSetData.tsCreated); 796 796 except: oBuildValidationKitDataEx = None; 797 797 oTestBoxData = TestBoxData().initFromDbWithGenId(self._oDb, oTestSetData.idGenTestBox); -
trunk/src/VBox/ValidationKit/testmanager/webui/wuitestresult.py
r56295 r56806 62 62 if db.isDbTimestamp(oObject): 63 63 return webutils.escapeElem(self.formatTsShort(oObject)); 64 if db.isDbInterval(oObject): 65 return webutils.escapeElem(self.formatIntervalShort(oObject)); 64 66 if utils.isString(oObject): 65 67 return webutils.escapeElem(oObject); … … 164 166 webutils.escapeElem(self.formatTsShort(tsEvent)), 165 167 sElapsedGraph, 166 webutils.escapeElem(str(oTestResult.tsElapsed)) if oTestResult.tsElapsed is not None else '', 168 webutils.escapeElem(self.formatIntervalShort(oTestResult.tsElapsed)) if oTestResult.tsElapsed is not None 169 else '', 167 170 sDisplayName, 168 171 ' id="failure-%u"' % (iFailure,) if oTestResult.isFailure() else '', … … 286 289 webutils.escapeElem(self.formatTsShort(oTestResult.tsCreated + oTestResult.tsElapsed)), 287 290 sElapsedGraph, 288 webutils.escapeElem(s tr(oTestResult.tsElapsed)),291 webutils.escapeElem(self.formatIntervalShort(oTestResult.tsElapsed)), 289 292 sDisplayName, 290 293 ' id="failure-%u"' % (iFailure,) if oTestResult.isFailure() else '',
Note:
See TracChangeset
for help on using the changeset viewer.