VirtualBox

Ignore:
Timestamp:
May 30, 2016 12:57:40 PM (9 years ago)
Author:
vboxsync
Message:

arg. bugs. sorting indicator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py

    r61289 r61291  
    264264        return u'<td align="center">%u</td>' % (oSet.dcHitsPerId[idKey],);
    265265
    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):
    267268        """
    268269        Turns the set into a table.
     
    276277        # Header row.
    277278        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                                                       '&#x25bc;' if iPeriod == iSortColumn else '');
    280282        if fWithTotals:
    281             sHtml += u'<th colspan="%d">Total</th>' % (cColsPerSeries,);
     283            sHtml += u'<th colspan="%d">Total%s</th>' % (cColsPerSeries,
     284                                                         '&#x25bc;' if iSortColumn == len(oSet.aoPeriods) else '');
    282285        sHtml += u'</thead></td>\n';
    283286
     
    308311    def _getSortedIds(self, oSet, fByTotal = None):
    309312        """
    310         Get default sorted subject IDs.
     313        Get default sorted subject IDs and which column.
    311314        """
    312315
     
    319322                                  key = lambda idKey: oSet.dcHitsPerId[idKey] * 10000 / oSet.dcTotalPerId[idKey],
    320323                                  reverse = True);
     324            iColumn = len(oSet.aoPeriods);
    321325        else:
    322326            # Sort by NOW column.
     
    327331                else:               dTmp[idKey] = oRow.cHits * 10000 / max(1, oRow.cTotal);
    328332            aidSortedRaw = sorted(dTmp, key = lambda idKey: dTmp[idKey], reverse = True);
    329         return aidSortedRaw;
     333            iColumn = 0;
     334        return (aidSortedRaw, iColumn);
    330335
    331336    def _generateGraph(self, oSet, sIdBase, aidSortedRaw):
     
    410415        # Generate table and transition list. These are the most useful ones with the current graph machinery.
    411416        #
    412         sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw);
     417        sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw, len(oSet.aoPeriods));
    413418        sHtml += self._generateTransitionList(oSet);
    414419
     
    485490        self._sTitle = 'Test Case Failures';
    486491        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);
    490495        sHtml += self._generateTransitionList(oSet);
    491496        sHtml += self._generateGraph(oSet, 'testcase-graph', aidSortedRaw);
     
    524529        self._sTitle = 'Test Case Variation Failures';
    525530        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);
    529534        sHtml += self._generateTransitionList(oSet);
    530535        sHtml += self._generateGraph(oSet, 'testcasearg-graph', aidSortedRaw);
     
    556561        self._sTitle = 'Test Box Failures';
    557562        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);
    561566        sHtml += self._generateTransitionList(oSet);
    562567        sHtml += self._generateGraph(oSet, 'testbox-graph', aidSortedRaw);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette