VirtualBox

Ignore:
Timestamp:
Jun 11, 2019 3:26:40 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131252
Message:

ValKit,++: Pylint 2.3.1 adjustments.

Location:
trunk/src/VBox/ValidationKit/testmanager
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py

    r79087 r79092  
    5050
    5151if sys.version_info[0] >= 3:
    52     from io       import StringIO as StringIO;      # pylint: disable=import-error,no-name-in-module
     52    from io       import StringIO as StringIO;      # pylint: disable=import-error,no-name-in-module,useless-import-alias
    5353else:
    54     from StringIO import StringIO as StringIO;      # pylint: disable=import-error,no-name-in-module
     54    from StringIO import StringIO as StringIO;      # pylint: disable=import-error,no-name-in-module,useless-import-alias
    5555from optparse import OptionParser;                  # pylint: disable=deprecated-module
    5656from PIL import Image;                              # pylint: disable=import-error
     
    10271027        # (  Whether to stop on hit, reason tuple, needle text. )
    10281028        ( True,  ktReason_Panic_HugeMemory,                         'mm/huge_memory.c:1988' ),
    1029         ( True,  ktReason_Panic_IOAPICDoesntWork,                   'IO-APIC + timer doesn''t work' ),
     1029        ( True,  ktReason_Panic_IOAPICDoesntWork,                   'IO-APIC + timer doesn\'t work' ),
    10301030        ( True,  ktReason_Panic_TxUnitHang,                         'Detected Tx Unit Hang' ),
    10311031        ( True,  ktReason_GuestBug_CompizVBoxQt,                    'error 4 in libQt5CoreVBox' ),
  • trunk/src/VBox/ValidationKit/testmanager/cgi/logout.py

    r76553 r79092  
    5050    oSrvGlue = WebServerGlueCgi(g_ksValidationKitDir, fHtmlOutput = True)
    5151    sUser = oSrvGlue.getLoginName()
    52     if sUser != oSrvGlue.ksUnknownUser and sUser != 'logout':
     52    if sUser not in (oSrvGlue.ksUnknownUser, 'logout'):
    5353        oSrvGlue.write('<p>Broken apache config!\n'
    5454                       'The logout.py script should be configured with .htaccess-logout and require user logout!</p>')
  • trunk/src/VBox/ValidationKit/testmanager/core/build.py

    r79087 r79092  
    725725
    726726        for aoRow in aaoRows:
    727             oBuildExRet = BuildDataEx().initFromDbRow(self, aoRow);
     727            oBuildExRet = BuildDataEx().initFromDbRow(aoRow);
    728728            if not self.isBuildBlacklisted(oBuildExRet):
    729729                return oBuildExRet;
  • trunk/src/VBox/ValidationKit/testmanager/core/buildblacklist.py

    r79087 r79092  
    5353    ksParam_iLastRevision   = 'BuildBlacklist_iLastRevision'
    5454
    55     kasAllowNullAttributes    = [ 'idBlacklisting',
    56                                   'tsEffective',
    57                                   'tsExpire',
    58                                   'uidAuthor',
    59                                   'asTypes',
    60                                   'asOsArches' ];
     55    kasAllowNullAttributes  = [ 'idBlacklisting',
     56                                'tsEffective',
     57                                'tsExpire',
     58                                'uidAuthor',
     59                                'asTypes',
     60                                'asOsArches' ];
    6161
    6262    def __init__(self):
  • trunk/src/VBox/ValidationKit/testmanager/core/buildsource.py

    r79087 r79092  
    128128                                                                             aoNilValues, fAllowNull, oDb);
    129129            if sError is None:
    130                 if len(self.asTypes) <= 0:
     130                if not self.asTypes:
    131131                    oNewValue = None;
    132132                else:
  • trunk/src/VBox/ValidationKit/testmanager/core/db.py

    r79087 r79092  
    6666        ## @todo detect strings as well.
    6767        return False;
    68     return getattr(oValue, 'pydatetime', None) != None;
     68    return getattr(oValue, 'pydatetime', None) is not None;
    6969
    7070def dbTimestampToDatetime(oValue):
     
    127127    Otherwise, we won't be able to log the issue.
    128128    """
    129     pass;
     129    pass;                               # pylint: disable=unnecessary-pass
    130130
    131131
  • trunk/src/VBox/ValidationKit/testmanager/core/schedulerbase.py

    r79087 r79092  
    787787        oTestSet      = TestSetData().initFromDbWithId(oDb, idTestSet);
    788788        oTestBox      = TestBoxData().initFromDbWithGenId(oDb, oTestSet.idGenTestBox);
    789         oTestEx       = TestCaseArgsDataEx().initFromDbWithGenId(oDb, oTestSet.idGenTestCaseArgs);
     789        oTestEx       = TestCaseArgsDataEx().initFromDbWithGenIdEx(oDb, oTestSet.idGenTestCaseArgs,
     790                                                                   tsConfigEff = oTestSet.tsConfig,
     791                                                                   tsRsrcEff = oTestSet.tsConfig);
    790792        oBuild        = BuildDataEx().initFromDbWithId(oDb, oTestSet.idBuild);
    791793        oValidationKitBuild = None;
     
    14781480                            , (oTestSetData.idTestSetGangLeader,) );
    14791481                oTask = SchedQueueData().initFromDbRow(oDb.fetchOne());
    1480                 oTestEx = TestCaseArgsDataEx().initFromDbWithGenId(oDb, oTask.idGenTestCaseArgs);
    1481 
     1482                oTestEx = TestCaseArgsDataEx().initFromDbWithGenIdEx(oDb, oTask.idGenTestCaseArgs,
     1483                                                                     tsConfigEff = oTask.tsConfig,
     1484                                                                     tsRsrcEff = oTask.tsConfig);
    14821485                oDb.execute('UPDATE SchedQueues\n'
    14831486                            '   SET idItem = NEXTVAL(\'SchedQueueItemIdSeq\'),\n'
     
    14901493                return True;
    14911494
    1492             elif oStatusData.enmState == TestBoxStatusData.ksTestBoxState_GangGatheringTimedOut:
     1495            if oStatusData.enmState == TestBoxStatusData.ksTestBoxState_GangGatheringTimedOut:
    14931496                oDb.rollback();
    14941497                return True;
  • trunk/src/VBox/ValidationKit/testmanager/core/testcaseargs.py

    r79087 r79092  
    351351    def addTestCaseArgs(self, oTestCaseArgsData):
    352352        """Add Test Case Args record into DB"""
    353         pass
     353        pass;                               # pylint: disable=unnecessary-pass
    354354
    355355    def cachedLookup(self, idTestCaseArgs):
  • trunk/src/VBox/ValidationKit/testmanager/core/testresults.py

    r79087 r79092  
    671671class TestResultHangingOffence(TMExceptionBase):
    672672    """Hanging offence committed by test case."""
    673     pass;
     673    pass;                               # pylint: disable=unnecessary-pass
    674674
    675675
     
    27282728
    27292729        elif sName == 'PopHint':
    2730             if len(aaiHints) < 1:
     2730            if not aaiHints:
    27312731                return 'No hint to pop.'
    27322732
  • trunk/src/VBox/ValidationKit/testmanager/core/webservergluebase.py

    r76553 r79092  
    4545    For exceptions raised by glue code.
    4646    """
    47     pass;
     47    pass;                               # pylint: disable=unnecessary-pass
    4848
    4949
     
    153153        Note! This includes both a leading an trailing slash.
    154154        """
    155         sPath = self.getUrlPath();
     155        sPath = self.getUrlPath();      # virtual method # pylint: disable=assignment-from-no-return
    156156        iLastSlash = sPath.rfind('/');
    157157        if iLastSlash >= 0:
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuibase.py

    r79087 r79092  
    5353    For exceptions raised by Web UI code.
    5454    """
    55     pass;
     55    pass;                               # pylint: disable=unnecessary-pass
    5656
    5757
     
    410410        # HACK: Checkboxes doesn't return a value when unchecked, so we always
    411411        #       provide a default when dealing with boolean parameters.
    412         return sValue == 'True' or sValue == 'true' or sValue == '1';
     412        return sValue in ('True', 'true', '1',);
    413413
    414414    def getIntParam(self, sName, iMin = None, iMax = None, iDefault = None):
     
    547547            oListEntryTestCaseArgs = []
    548548            for idTestCaseArgs in aiAllTestCaseArgs:
    549                 fArgsChecked   = True if idTestCaseArgs in aiCheckedTestCaseArgs else False
     549                fArgsChecked   = idTestCaseArgs in aiCheckedTestCaseArgs;
    550550
    551551                # Dry run
     
    562562            sTestCaseName = self.getStringParam('%s[%d][sName]' % (sName, idTestCase), sDefault='')
    563563
    564             oListEntryTestCase = \
    565                 (idTestCase,
    566                  True if idTestCase in aiSelectedTestCaseIds else False,
    567                  sTestCaseName,
    568                  oListEntryTestCaseArgs)
     564            oListEntryTestCase = (
     565                idTestCase,
     566                idTestCase in aiSelectedTestCaseIds,
     567                sTestCaseName,
     568                oListEntryTestCaseArgs
     569            );
    569570
    570571            aoListOfTestCases.append(oListEntryTestCase)
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py

    r79087 r79092  
    5454    def __init__(self):
    5555        """Dummy init to shut up pylint."""
    56         pass;
     56        pass;                               # pylint: disable=unnecessary-pass
    5757
    5858    def toHtml(self):
     
    732732        aoRet = []
    733733        for sListItem in asListItems:
    734             fEnabled = True if sListItem in asSelectedItems else False
     734            fEnabled = sListItem in asSelectedItems;
    735735            aoRet.append((sListItem, fEnabled, sListItem))
    736736        return aoRet
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuigraphwiz.py

    r76553 r79092  
    205205        # Must be at least two series for something to be splittable.
    206206        if len(aoSeries) <= 1:
    207             if len(aoSeries) < 1:
     207            if not aoSeries:
    208208                return [];
    209209            return [aoSeries,];
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuihlpgraphgooglechart.py

    r79087 r79092  
    4242class WuiHlpGraphGoogleChartsBase(WuiHlpGraphBase):
    4343    """ Base class for the Google Charts graphs. """
    44     pass;
     44    pass;                               # pylint: disable=unnecessary-pass
    4545
    4646
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuihlpgraphmatplotlib.py

    r79087 r79092  
    3333import sys;
    3434if sys.version_info[0] >= 3:
    35     from io       import StringIO as StringIO;  # pylint: disable=import-error,no-name-in-module
     35    from io       import StringIO as StringIO;  # pylint: disable=import-error,no-name-in-module,useless-import-alias
    3636else:
    37     from StringIO import StringIO as StringIO;  # pylint: disable=import-error,no-name-in-module
     37    from StringIO import StringIO as StringIO;  # pylint: disable=import-error,no-name-in-module,useless-import-alias
    3838
    3939import matplotlib;                              # pylint: disable=import-error
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuihlpgraphsimple.py

    r76553 r79092  
    148148    """
    149149
    150     pass;
     150    pass;                               # pylint: disable=unnecessary-pass
    151151
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuimain.py

    r79087 r79092  
    759759        oTrLogic = TestResultLogic(self._oDb);
    760760        sAltSelectorAction = None;
    761         if   enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeNone \
    762           or enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeTestBox:
     761        if enmResultsGroupingType in (TestResultLogic.ksResultsGroupingTypeNone, TestResultLogic.ksResultsGroupingTypeTestBox,):
    763762            aoTmp = oTrLogic.getTestBoxes(tsNow = tsEffective, sPeriod = sCurPeriod)
    764             aoGroupMembers = sorted(list(set([ (x.idTestBox, '%s (%s)' % (x.sName, str(x.ip))) for x in aoTmp ])),
     763            aoGroupMembers = sorted(list({(x.idTestBox, '%s (%s)' % (x.sName, str(x.ip))) for x in aoTmp }),
    765764                                    reverse = False, key = lambda asData: asData[1])
    766765
     
    774773        elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeTestGroup:
    775774            aoTmp = oTrLogic.getTestGroups(tsNow = tsEffective, sPeriod = sCurPeriod);
    776             aoGroupMembers = sorted(list(set([ (x.idTestGroup, x.sName ) for x in aoTmp ])),
     775            aoGroupMembers = sorted(list({ (x.idTestGroup, x.sName ) for x in aoTmp }),
    777776                                    reverse = False, key = lambda asData: asData[1])
    778777            self._sPageTitle = 'Grouped by Test Group'
     
    780779        elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeBuildRev:
    781780            aoTmp = oTrLogic.getBuilds(tsNow = tsEffective, sPeriod = sCurPeriod)
    782             aoGroupMembers = sorted(list(set([ (x.iRevision, '%s.%d' % (x.oCat.sBranch, x.iRevision)) for x in aoTmp ])),
     781            aoGroupMembers = sorted(list({ (x.iRevision, '%s.%d' % (x.oCat.sBranch, x.iRevision)) for x in aoTmp }),
    783782                                    reverse = True, key = lambda asData: asData[0])
    784783            self._sPageTitle = 'Grouped by Build'
     
    786785        elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeBuildCat:
    787786            aoTmp = oTrLogic.getBuildCategories(tsNow = tsEffective, sPeriod = sCurPeriod)
    788             aoGroupMembers = sorted(list(set([ ( x.idBuildCategory, '%s / %s / %s / %s'
    789                                                 % ( x.sProduct, x.sBranch, ', '.join(x.asOsArches), x.sType) )
    790                                                for x in aoTmp ])),
     787            aoGroupMembers = sorted(list({ (x.idBuildCategory,
     788                                            '%s / %s / %s / %s' % ( x.sProduct, x.sBranch, ', '.join(x.asOsArches), x.sType) )
     789                                           for x in aoTmp }),
    791790                                    reverse = True, key = lambda asData: asData[1]);
    792791            self._sPageTitle = 'Grouped by Build Category'
     
    794793        elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeTestCase:
    795794            aoTmp = oTrLogic.getTestCases(tsNow = tsEffective, sPeriod = sCurPeriod)
    796             aoGroupMembers = sorted(list(set([ (x.idTestCase, '%s' % x.sName) for x in aoTmp ])),
     795            aoGroupMembers = sorted(list({ (x.idTestCase, '%s' % x.sName) for x in aoTmp }),
    797796                                    reverse = False, key = lambda asData: asData[1])
    798797            self._sPageTitle = 'Grouped by Test Case'
     
    810809        elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeSchedGroup:
    811810            aoTmp = oTrLogic.getSchedGroups(tsNow = tsEffective, sPeriod = sCurPeriod)
    812             aoGroupMembers = sorted(list(set([ (x.idSchedGroup, '%s' % x.sName) for x in aoTmp ])),
     811            aoGroupMembers = sorted(list({ (x.idSchedGroup, '%s' % x.sName) for x in aoTmp }),
    813812                                    reverse = False, key = lambda asData: asData[1])
    814813            self._sPageTitle = 'Grouped by Scheduling Group'
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py

    r79087 r79092  
    9191        Returns HTML.
    9292        """
    93         assert sWhere == 'top' or sWhere == 'bottom';
     93        assert sWhere in ('top', 'bottom',);
    9494
    9595        return '';
Note: See TracChangeset for help on using the changeset viewer.

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