VirtualBox

Ignore:
Timestamp:
Mar 8, 2022 2:57:25 PM (3 years ago)
Author:
vboxsync
Message:

testmanager: pylint 2.9.6 adjustments (mostly about using sub-optimal looping and 'with' statements).

File:
1 edited

Legend:

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

    r93115 r94129  
    8383                                    'border="0" cellspacing="0" cellpadding="0">\n' \
    8484                     % (escapeElem(oRow.sName), escapeAttr(str(self.cxMaxBar + 2)));
    85             for j in range(len(oRow.aoValues)):
    86                 oValue = oRow.aoValues[j];
     85            for j, oValue in enumerate(oRow.aoValues):
    8786                cPct   = int(float(oValue) * 100 / fpMax);
    8887                cxBar  = int(float(oValue) * self.cxMaxBar / fpMax);
     
    125124        sReport += '<div class="tmgraphlegend">\n' \
    126125                   '  <p>Legend:\n';
    127         for j in range(len(aoTable[0].asValues)):
     126        for j, sValue in enumerate(aoTable[0].asValues):
    128127            sColor = self.kasColors[j % len(self.kasColors)];
    129             sReport += '    <font color="%s">&#x25A0; %s</font>\n' \
    130                      % (sColor, escapeElem(aoTable[0].asValues[j]));
     128            sReport += '    <font color="%s">&#x25A0; %s</font>\n' % (sColor, escapeElem(sValue),);
    131129        sReport += '  </p>\n' \
    132130                   '</div>\n';
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