Changeset 61291 in vbox for trunk/src/VBox/ValidationKit/testmanager/webui
- Timestamp:
- May 30, 2016 12:57:40 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py
r61289 r61291 264 264 return u'<td align="center">%u</td>' % (oSet.dcHitsPerId[idKey],); 265 265 266 def _generateTableForSet(self, oSet, sColumnName, aidSorted = None, fWithTotals = True, cColsPerSeries = None): 266 def _generateTableForSet(self, oSet, sColumnName, aidSorted = None, iSortColumn = 0, 267 fWithTotals = True, cColsPerSeries = None): 267 268 """ 268 269 Turns the set into a table. … … 276 277 # Header row. 277 278 sHtml += u' <tr><thead><th></th><th>%s</th>' % (webutils.escapeElem(sColumnName),) 278 for oPeriod in reversed(oSet.aoPeriods): 279 sHtml += u'<th colspan="%d">%s</th>' % (cColsPerSeries, webutils.escapeElem(oPeriod.sDesc),); 279 for iPeriod, oPeriod in enumerate(reversed(oSet.aoPeriods)): 280 sHtml += u'<th colspan="%d">%s%s</th>' % ( cColsPerSeries, webutils.escapeElem(oPeriod.sDesc), 281 '▼' if iPeriod == iSortColumn else ''); 280 282 if fWithTotals: 281 sHtml += u'<th colspan="%d">Total</th>' % (cColsPerSeries,); 283 sHtml += u'<th colspan="%d">Total%s</th>' % (cColsPerSeries, 284 '▼' if iSortColumn == len(oSet.aoPeriods) else ''); 282 285 sHtml += u'</thead></td>\n'; 283 286 … … 308 311 def _getSortedIds(self, oSet, fByTotal = None): 309 312 """ 310 Get default sorted subject IDs .313 Get default sorted subject IDs and which column. 311 314 """ 312 315 … … 319 322 key = lambda idKey: oSet.dcHitsPerId[idKey] * 10000 / oSet.dcTotalPerId[idKey], 320 323 reverse = True); 324 iColumn = len(oSet.aoPeriods); 321 325 else: 322 326 # Sort by NOW column. … … 327 331 else: dTmp[idKey] = oRow.cHits * 10000 / max(1, oRow.cTotal); 328 332 aidSortedRaw = sorted(dTmp, key = lambda idKey: dTmp[idKey], reverse = True); 329 return aidSortedRaw; 333 iColumn = 0; 334 return (aidSortedRaw, iColumn); 330 335 331 336 def _generateGraph(self, oSet, sIdBase, aidSortedRaw): … … 410 415 # Generate table and transition list. These are the most useful ones with the current graph machinery. 411 416 # 412 sHtml = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw );417 sHtml = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw, len(oSet.aoPeriods)); 413 418 sHtml += self._generateTransitionList(oSet); 414 419 … … 485 490 self._sTitle = 'Test Case Failures'; 486 491 oSet = self._oModel.getTestCaseFailures(); 487 aidSortedRaw= self._getSortedIds(oSet);488 489 sHtml = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw );492 (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet); 493 494 sHtml = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw, iSortColumn); 490 495 sHtml += self._generateTransitionList(oSet); 491 496 sHtml += self._generateGraph(oSet, 'testcase-graph', aidSortedRaw); … … 524 529 self._sTitle = 'Test Case Variation Failures'; 525 530 oSet = self._oModel.getTestCaseVariationFailures(); 526 aidSortedRaw= self._getSortedIds(oSet);527 528 sHtml = self._generateTableForSet(oSet, 'Test Case Variations', aidSortedRaw );531 (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet); 532 533 sHtml = self._generateTableForSet(oSet, 'Test Case Variations', aidSortedRaw, iSortColumn); 529 534 sHtml += self._generateTransitionList(oSet); 530 535 sHtml += self._generateGraph(oSet, 'testcasearg-graph', aidSortedRaw); … … 556 561 self._sTitle = 'Test Box Failures'; 557 562 oSet = self._oModel.getTestBoxFailures(); 558 aidSortedRaw= self._getSortedIds(oSet);559 560 sHtml = self._generateTableForSet(oSet, 'Test Boxes', aidSortedRaw );563 (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet); 564 565 sHtml = self._generateTableForSet(oSet, 'Test Boxes', aidSortedRaw, iSortColumn); 561 566 sHtml += self._generateTransitionList(oSet); 562 567 sHtml += self._generateGraph(oSet, 'testbox-graph', aidSortedRaw);
Note:
See TracChangeset
for help on using the changeset viewer.