VirtualBox

Changeset 97673 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Nov 24, 2022 11:46:15 AM (2 years ago)
Author:
vboxsync
Message:

Validation Kit: Fixed lots of warnings, based on pylint 2.12.2.

Location:
trunk/src/VBox/ValidationKit
Files:
45 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py

    r96412 r97673  
    650650            else:
    651651                try:
    652                     oOut = open(sOutFile, 'w');                 # pylint: disable=consider-using-with
     652                    oOut = open(sOutFile, 'w');                 # pylint: disable=consider-using-with,unspecified-encoding
    653653                except Exception as oXcpt:
    654654                    print('error! Failed open "%s" for writing: %s' % (sOutFile, oXcpt,));
  • trunk/src/VBox/ValidationKit/common/utils.py

    r97672 r97673  
    224224        try:
    225225            # try /etc/lsb-release first to distinguish between Debian and Ubuntu
    226             with open('/etc/lsb-release') as oFile:
     226            with open('/etc/lsb-release') as oFile: # pylint: disable=unspecified-encoding
    227227                for sLine in oFile:
    228228                    oMatch = re.search(r'(?:DISTRIB_DESCRIPTION\s*=)\s*"*(.*)"', sLine);
     
    245245                if os.path.isfile(sFile):
    246246                    try:
    247                         with open(sFile) as oFile:
     247                        with open(sFile) as oFile: # pylint: disable=unspecified-encoding
    248248                            sLine = oFile.readline();
    249249                    except:
     
    258258        if os.path.isfile('/etc/release'):
    259259            try:
    260                 with open('/etc/release') as oFile:
     260                with open('/etc/release') as oFile: # pylint: disable=unspecified-encoding
    261261                    sLast = oFile.readlines()[-1];
    262262                sLast = sLast.strip();
     
    387387    uPythonVer = (sys.version_info[0] << 16) | (sys.version_info[1] & 0xffff);
    388388    if uPythonVer >= ((3 << 16) | 4):
    389         oFile = open(sFile, sMode);                             # pylint: disable=consider-using-with
     389        oFile = open(sFile, sMode);                             # pylint: disable=consider-using-with,unspecified-encoding
    390390    else:
    391391        try:
     
    397397                    offComma = sMode.find(',');
    398398                    if offComma < 0:
    399                         return open(sFile, sMode + 'N');        # pylint: disable=consider-using-with
    400                     return open(sFile,                          # pylint: disable=consider-using-with,bad-open-mode
     399                        return open(sFile, sMode + 'N');        # pylint: disable=consider-using-with,unspecified-encoding
     400                    return open(sFile,                          # pylint: disable=consider-using-with,unspecified-encoding,bad-open-mode
    401401                                sMode[:offComma] + 'N' + sMode[offComma:]);
    402402
    403403            # Just in case.
    404             return open(sFile, sMode);                          # pylint: disable=consider-using-with
    405 
    406         oFile = open(sFile, sMode);                             # pylint: disable=consider-using-with
     404            return open(sFile, sMode);                          # pylint: disable=consider-using-with,unspecified-encoding
     405
     406        oFile = open(sFile, sMode);                             # pylint: disable=consider-using-with,unspecified-encoding
    407407        #try:
    408408        fcntl(oFile, F_SETFD, fcntl(oFile, F_GETFD) | FD_CLOEXEC);
     
    464464        oFile = os.fdopen(fdFile, sMode);
    465465    else:
    466         oFile = open(sFile, sMode);                                     # pylint: disable=consider-using-with
     466        oFile = open(sFile, sMode);                                     # pylint: disable=consider-using-with,unspecified-encoding
    467467
    468468        # Python 3.4 and later automatically creates non-inherit handles. See PEP-0446.
     
    493493    Reads the entire file.
    494494    """
    495     with open(sFile, sMode) as oFile:
     495    with open(sFile, sMode) as oFile: # pylint: disable=unspecified-encoding
    496496        sRet = oFile.read();
    497497    return sRet;
     
    10201020            if oXcpt.winerror == winerror.ERROR_ACCESS_DENIED:
    10211021                fRc = True;
    1022         except Exception as oXcpt:
     1022        except:
    10231023            pass;
    10241024        else:
     
    13811381                sFull = os.path.join(sDir, sEntry);
    13821382                try:
    1383                     with open(sFull, 'r') as oFile:
     1383                    with open(sFull, 'r') as oFile: # pylint: disable=unspecified-encoding
    13841384                        sFirstLine = oFile.readline();
    13851385                except:
     
    24872487
    24882488    uCrc32 = 0;
    2489     with open(sFile, 'rb') as oFile:
     2489    with open(sFile, 'rb') as oFile: # pylint: disable=unspecified-encoding
    24902490        while True:
    24912491            oBuf = oFile.read(1024 * 1024);
  • trunk/src/VBox/ValidationKit/common/webutils.py

    r96407 r97673  
    173173                oOpener = urllib_build_opener();
    174174            else:
    175                 oOpener = urllib_build_opener(urllib_ProxyHandler(proxies = dict()));
     175                oOpener = urllib_build_opener(urllib_ProxyHandler(proxies = {} ));
    176176            oSrc = oOpener.open(sUrlFile);
    177177            oDst = utils.openNoInherit(sDstFile, 'wb');
  • trunk/src/VBox/ValidationKit/testboxscript/testboxcommand.py

    r96407 r97673  
    286286        try:
    287287            sCmdName = oResponse.getStringChecked(constants.tbresp.ALL_PARAM_RESULT);
    288         except Exception as oXcpt:
     288        except:
    289289            oConnection.close();
    290290            return False;
  • trunk/src/VBox/ValidationKit/testboxscript/testboxconnection.py

    r96407 r97673  
    9393        else:
    9494            # Special case, dummy response object.
    95             self._dResponse = dict();
     95            self._dResponse = {};
    9696        # Done.
    9797
     
    230230        """
    231231        if dParams is None:
    232             dParams = dict();
     232            dParams = {};
    233233        dParams[constants.tbreq.ALL_PARAM_TESTBOX_ID]   = self._sTestBoxId;
    234234        dParams[constants.tbreq.ALL_PARAM_TESTBOX_UUID] = self._sTestBoxUuid;
  • trunk/src/VBox/ValidationKit/testboxscript/testboxtasks.py

    r96407 r97673  
    100100        self._lock();
    101101        self._fRunning = False;
    102         self._oCv.notifyAll();
     102        self._oCv.notifyAll(); # pylint: disable=deprecated-method
    103103        self._unlock();
    104104
  • trunk/src/VBox/ValidationKit/testdriver/base.py

    r97672 r97673  
    8282    Returns the executable suffix.
    8383    """
    84     if os.name == 'nt' or os.name == 'os2':
     84    if os.name in ('nt', 'os2'):
    8585        return '.exe';
    8686    return '';
     
    484484            reporter.log2('signalTaskLocked(%s)' % (self,));
    485485        self.fSignalled = True;
    486         self.oCv.notifyAll()
     486        self.oCv.notifyAll(); # pylint: disable=deprecated-method
    487487        if self.oOwner is not None:
    488488            self.oOwner.notifyAboutReadyTask(self);
     
    14311431            self.asActions.append(asArgs[iArg])
    14321432        elif asArgs[iArg] in self.asSpecialActions:
    1433             if self.asActions != []:
     1433            if self.asActions:
    14341434                raise InvalidOption('selected special action "%s" already' % (self.asActions[0], ));
    14351435            self.asActions = [ asArgs[iArg] ];
     
    17051705                        raise InvalidOption('unknown option: %s' % (asArgs[iArg]))
    17061706                iArg = iNext;
    1707         except QuietInvalidOption as oXcpt:
     1707        except QuietInvalidOption:
    17081708            return rtexitcode.RTEXITCODE_SYNTAX;
    17091709        except InvalidOption as oXcpt:
     
    17181718            return rtexitcode.RTEXITCODE_SYNTAX;
    17191719
    1720         if self.asActions == []:
     1720        if not self.asActions:
    17211721            reporter.error('no action was specified');
    17221722            reporter.error('valid actions: %s' % (self.asNormalActions + self.asSpecialActions + ['all']));
     
    17901790            self.pidFileRemove(os.getpid());
    17911791
    1792         if asActions != [] and fRc is True:
     1792        if asActions and fRc is True:
    17931793            reporter.error('unhandled actions: %s' % (asActions,));
    17941794            fRc = False;
  • trunk/src/VBox/ValidationKit/testdriver/txsclient.py

    r96407 r97673  
    485485        self.aTaskArgs      = aArgs;
    486486        self.oThread        = threading.Thread(target=self.taskThread, args=(), name=('TXS-%s' % (sStatus)));
    487         self.oThread.setDaemon(True);
     487        self.oThread.setDaemon(True); # pylint: disable=deprecated-method
    488488        self.msStart        = base.timestampMilli();
    489489
  • trunk/src/VBox/ValidationKit/testdriver/vbox.py

    r97545 r97673  
    558558        self.oThread = threading.Thread(target = self.threadForPassiveMode, \
    559559            args=(), name=('PAS-%s' % (self.sName,)));
    560         self.oThread.setDaemon(True)
     560        self.oThread.setDaemon(True); # pylint: disable=deprecated-method
    561561        self.oThread.start();
    562562        return None;
     
    19811981        """
    19821982        sAdpName = '';
    1983         if    oNic.adapterType == vboxcon.NetworkAdapterType_Am79C970A \
    1984             or oNic.adapterType == vboxcon.NetworkAdapterType_Am79C973 \
    1985             or oNic.adapterType == vboxcon.NetworkAdapterType_Am79C960:
     1983        if    oNic.adapterType in (vboxcon.NetworkAdapterType_Am79C970A, \
     1984                                   vboxcon.NetworkAdapterType_Am79C973, \
     1985                                   vboxcon.NetworkAdapterType_Am79C960):
    19861986            sAdpName = 'pcnet';
    1987         elif    oNic.adapterType == vboxcon.NetworkAdapterType_I82540EM \
    1988             or oNic.adapterType == vboxcon.NetworkAdapterType_I82543GC \
    1989             or oNic.adapterType == vboxcon.NetworkAdapterType_I82545EM:
     1987        elif    oNic.adapterType in (vboxcon.NetworkAdapterType_I82540EM, \
     1988                                     vboxcon.NetworkAdapterType_I82543GC, \
     1989                                     vboxcon.NetworkAdapterType_I82545EM):
    19901990            sAdpName = 'e1000';
    19911991        elif oNic.adapterType == vboxcon.NetworkAdapterType_Virtio:
  • trunk/src/VBox/ValidationKit/testdriver/vboxinstaller.py

    r96431 r97673  
    266266        sFull = self.__persistentVarCalcName(sVar);
    267267        try:
    268             with open(sFull, 'w') as oFile:
     268            with open(sFull, 'w') as oFile: # pylint: disable=unspecified-encoding
    269269                if sValue:
    270270                    oFile.write(sValue.encode('utf-8'));
     
    318318            return None;
    319319        try:
    320             with open(sFull, 'r') as oFile:
     320            with open(sFull, 'r') as oFile: # pylint: disable=unspecified-encoding
    321321                sValue = oFile.read().decode('utf-8');
    322322        except:
  • trunk/src/VBox/ValidationKit/testdriver/vboxtestvms.py

    r96407 r97673  
    15541554
    15551555        for oTestVm in self.aoTestVms:
    1556             if oTestVm.sVmName == sVmName or oTestVm.sVmName == sAltName:
     1556            if oTestVm.sVmName in (sVmName, sAltName):
    15571557                return oTestVm;
    15581558        return None;
  • trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py

    r96407 r97673  
    155155        The new instance is returned on success.  None is returned on error.
    156156        """
    157         dArgsCopy = dArgs.copy() if dArgs is not None else dict();
     157        dArgsCopy = dArgs.copy() if dArgs is not None else {};
    158158        dArgsCopy['oVBox'] = self;
    159159        return oSubClass.registerDerivedEventHandler(self.oVBoxMgr, self.fpApiVer, oSubClass, dArgsCopy,
     
    28682868            return False
    28692869
    2870         with open(sFilename, 'wb') as oFile:
     2870        with open(sFilename, 'wb') as oFile: # pylint: disable=unspecified-encoding
    28712871            oFile.write(aPngData)
    28722872
     
    31033103
    31043104        # Add the base class arguments.
    3105         dArgsCopy = dArgs.copy() if dArgs is not None else dict();
     3105        dArgsCopy = dArgs.copy() if dArgs is not None else {};
    31063106        dArgsCopy['oSession'] = self;
    31073107        dArgsCopy['oConsole'] = oConsole;
  • trunk/src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py

    r97668 r97673  
    350350
    351351        if self.oConfig.sLogFile:
    352             self.oLogFile = open(self.oConfig.sLogFile, "a");   # pylint: disable=consider-using-with
     352            self.oLogFile = open(self.oConfig.sLogFile, "a");   # pylint: disable=consider-using-with,unspecified-encoding
    353353            self.oLogFile.write('VirtualTestSheriff: $Revision$ \n');
    354354
  • trunk/src/VBox/ValidationKit/testmanager/config.py

    r96407 r97673  
    5353# @{
    5454g_ksDatabaseName        = 'testmanager';
    55 g_ksDatabaseAddress     = None;
    56 g_ksDatabasePort        = None;
     55g_ksDatabaseAddress     = 'localhost';
     56g_ksDatabasePort        = 5432;
    5757g_ksDatabaseUser        = 'postgres';
    58 g_ksDatabasePassword    = '';
     58g_ksDatabasePassword    = 'password';
    5959## @}
    6060
     
    8585g_ksTmDownloadBaseUrlRel = 'htdocs/downloads';
    8686## The root of the file area (referred to as TM_FILE_DIR in database docs).
    87 g_ksFileAreaRootDir     = '/var/tmp/testmanager'
     87g_ksFileAreaRootDir     = '/tmp/testmanager'
    8888## The root of the file area with the zip files (best put on a big storage server).
    89 g_ksZipFileAreaRootDir  = '/var/tmp/testmanager2'
     89g_ksZipFileAreaRootDir  = '/tmp/testmanager2'
    9090## URL prefix for trac log viewer.
    9191g_ksTracLogUrlPrefix    = 'https://linserv.de.oracle.com/vbox/log/'
     
    259259g_ksTestBoxDispXpctLog  = '/tmp/testmanager-testboxdisp-xcpt.log'
    260260## @}
    261 
  • trunk/src/VBox/ValidationKit/testmanager/core/base.py

    r96407 r97673  
    367367        Worker for implementing validateAndConvert().
    368368        """
    369         dErrors = dict();
     369        dErrors = {};
    370370        for sAttr in self.getDataAttributes():
    371371            oValue      = getattr(self, sAttr);
     
    413413            kasValidValues_enmAttr, and kasAllowNullAttributes.
    414414        """
    415         return self._validateAndConvertWorker(getattr(self, 'kasAllowNullAttributes', list()), oDb,
     415        return self._validateAndConvertWorker(getattr(self, 'kasAllowNullAttributes', []), oDb,
    416416                                              enmValidateFor = enmValidateFor);
    417417
     
    433433        sPrefix       = self.getHungarianPrefix(sAttr);
    434434        asValidValues = getattr(self, 'kasValidValues_' + sAttr, None);
    435         fAllowNull    = sAttr in getattr(self, 'kasAllowNullAttributes', list());
     435        fAllowNull    = sAttr in getattr(self, 'kasAllowNullAttributes', []);
    436436        if fStrict:
    437437            if sPrefix == 'f':
     
    14161416
    14171417        # Collect the parameter names.
    1418         dWanted = dict();
     1418        dWanted = {};
    14191419        for oCrit in self.aCriteria:
    14201420            dWanted[oCrit.sVarNm] = 1;
     
    14281428
    14291429        # To the straining.
    1430         dRet = dict();
     1430        dRet = {};
    14311431        for sKey in dParams:
    14321432            if sKey in dWanted:
  • trunk/src/VBox/ValidationKit/testmanager/core/buildblacklist.py

    r96407 r97673  
    227227
    228228        (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps();
    229         if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:
     229        if oData.tsEffective not in (tsCur, tsCurMinusOne):
    230230            self._historizeEntry(idBlacklisting, tsCurMinusOne);
    231231            self._readdEntry(uidAuthor, oData, tsCurMinusOne);
  • trunk/src/VBox/ValidationKit/testmanager/core/db.py

    r96407 r97673  
    269269
    270270        # Object caches (used by database logic classes).
    271         self.ddCaches = dict();
     271        self.ddCaches = {};
    272272
    273273    def isAutoCommitting(self):
     
    374374            sBound = oCursor.mogrify(unicode(sOperation), aoArgs);
    375375        elif sOperation.find('%') < 0:
    376             sBound = oCursor.mogrify(unicode(sOperation), list());
     376            sBound = oCursor.mogrify(unicode(sOperation), []);
    377377        else:
    378378            sBound = unicode(sOperation);
     
    426426        """
    427427        if aoArgs is None:
    428             aoArgs = list();
     428            aoArgs = [];
    429429
    430430        nsStart = utils.timestampNano();
     
    588588        dRet = self.ddCaches.get(sType, None);
    589589        if dRet is None:
    590             dRet = dict();
     590            dRet = {};
    591591            self.ddCaches[sType] = dRet;
    592592        return dRet;
  • trunk/src/VBox/ValidationKit/testmanager/core/dbobjcache.py

    r96407 r97673  
    7878
    7979        self._adCache    = (
    80             dict(), dict(), dict(), dict(),
    81             dict(), dict(), dict(), dict(),
    82             dict(),
     80            {}, {}, {}, {},
     81            {}, {}, {}, {},
     82            {},
    8383        );
    8484        assert(len(self._adCache) == self.ksObjType_End);
     
    158158        dRepo = self._adCache[self.ksObjType_VcsRevision_sRepository_iRevision].get(sRepository);
    159159        if dRepo is None:
    160             dRepo = dict();
     160            dRepo = {};
    161161            self._adCache[self.ksObjType_VcsRevision_sRepository_iRevision][sRepository] = dRepo;
    162162            aiFiltered = aiRevisions;
     
    187187            oRet = dRepo.get(iRevision);
    188188        else:
    189             dRepo = dict();
     189            dRepo = {};
    190190            self._adCache[self.ksObjType_VcsRevision_sRepository_iRevision][sRepository] = dRepo;
    191191            oRet = None;
  • trunk/src/VBox/ValidationKit/testmanager/core/failurecategory.py

    r96407 r97673  
    311311        oData = FailureCategoryData().initFromDbWithId(self._oDb, idFailureCategory);
    312312        (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps();
    313         if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:
     313        if oData.tsEffective not in (tsCur, tsCurMinusOne):
    314314            self._historizeEntry(idFailureCategory, tsCurMinusOne);
    315315            self._readdEntry(uidAuthor, oData, tsCurMinusOne);
  • trunk/src/VBox/ValidationKit/testmanager/core/failurereason.py

    r96407 r97673  
    431431        assert oData.idFailureReason == idFailureReason;
    432432        (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps();
    433         if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:
     433        if oData.tsEffective not in (tsCur, tsCurMinusOne):
    434434            self._historizeEntry(idFailureReason, tsCurMinusOne);
    435435            self._readdEntry(uidAuthor, oData, tsCurMinusOne);
  • trunk/src/VBox/ValidationKit/testmanager/core/schedgroup.py

    r96407 r97673  
    909909        #
    910910        (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps();
    911         if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:
     911        if oData.tsEffective not in (tsCur, tsCurMinusOne):
    912912            self._historizeEntry(idSchedGroup, tsCurMinusOne);
    913913            self._readdEntry(uidAuthor, oData, tsCurMinusOne);
     
    12601260        # Try record who removed it by adding an dummy entry that expires immediately.
    12611261        (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps();
    1262         if oMember.tsEffective != tsCur and oMember.tsEffective != tsCurMinusOne:
     1262        if oMember.tsEffective not in (tsCur, tsCurMinusOne):
    12631263            self._historizeSchedGroupMember(oMember, tsCurMinusOne);
    12641264            self._addSchedGroupMember(uidAuthor, oMember, tsCurMinusOne); # lazy bird.
     
    13101310        # Try record who removed it by adding an dummy entry that expires immediately.
    13111311        (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps();
    1312         if oBoxInGroup.tsEffective != tsCur and oBoxInGroup.tsEffective != tsCurMinusOne:
     1312        if oBoxInGroup.tsEffective not in (tsCur, tsCurMinusOne):
    13131313            self._historizeSchedGroupTestBox(oBoxInGroup, tsCurMinusOne);
    13141314            self._addSchedGroupTestBox(uidAuthor, oBoxInGroup, tsCurMinusOne); # lazy bird.
  • trunk/src/VBox/ValidationKit/testmanager/core/schedulerbase.py

    r96407 r97673  
    108108        # Generate a testcase lookup dictionary for use when working on
    109109        # argument variations.
    110         self.dTestCases         = dict();
     110        self.dTestCases         = {};
    111111        for oTestCase in self.aoTestCases:
    112112            self.dTestCases[oTestCase.idTestCase] = oTestCase;
     
    114114
    115115        # Generate a testgroup lookup dictionary.
    116         self.dTestGroups        = dict();
     116        self.dTestGroups        = {};
    117117        for oTestGroup in self.aoTestGroups:
    118118            self.dTestGroups[oTestGroup.idTestGroup] = oTestGroup;
     
    125125            # Prep the test groups.
    126126            for oTestGroup in self.aoTestGroups:
    127                 oTestGroup.aoTestCases = list();
    128                 oTestGroup.dTestCases  = dict();
     127                oTestGroup.aoTestCases = [];
     128                oTestGroup.dTestCases  = {};
    129129
    130130            # Link testcases to their group, both directions. Prep testcases for
     
    139139                oTestGroup.aoTestCases.append(oTestCase);
    140140                oTestCase.oTestGroup       = oTestGroup;
    141                 oTestCase.aoArgsVariations = list();
     141                oTestCase.aoArgsVariations = [];
    142142
    143143            # Associate testcase argument variations with their testcases (group)
     
    177177        Returns array of errors (see SchedulderBase.recreateQueue()).
    178178        """
    179         aoErrors = list();
     179        aoErrors = [];
    180180        for oTestGroup in self.aoTestGroups:
    181181            idPreReq = oTestGroup.idTestGroupPreReq;
    182182            if idPreReq is None:
    183                 oTestGroup.aidTestGroupPreReqs = list();
     183                oTestGroup.aidTestGroupPreReqs = [];
    184184                continue;
    185185
     
    214214        Returns array of errors (see SchedulderBase.recreateQueue()).
    215215        """
    216         aoErrors = list();
     216        aoErrors = [];
    217217        for oTestGroup in self.aoTestGroups:
    218218            for oTestCase in oTestGroup.aoTestCases:
     
    461461                self._fBlacklisted      = None if fMaybeBlacklisted is True else False;
    462462                self.fRemoved           = False;
    463                 self._dPreReqDecisions  = dict();
     463                self._dPreReqDecisions  = {};
    464464
    465465            def remove(self):
     
    531531        self._tsSecStart    = tsSecStart if tsSecStart is not None else utils.timestampSecond();
    532532        self.oBuildCache    = self.BuildCache();
    533         self.dTestGroupMembers = dict();
     533        self.dTestGroupMembers = {};
    534534
    535535    @staticmethod
     
    634634            # little for gang gathering).
    635635            #
    636             aoItems = list();
     636            aoItems = [];
    637637            if not oData.oSchedGroup.fEnabled:
    638638                self.msgInfo('Disabled.');
  • trunk/src/VBox/ValidationKit/testmanager/core/schedulerbeci.py

    r96407 r97673  
    8787        cMaxItems = min(cMaxItems, 1048576);
    8888
    89         aoItems   = list();
     89        aoItems   = [];
    9090        cNotAtEnd = len(oData.aoTestCases);
    9191        while len(aoItems) < cMaxItems:
  • trunk/src/VBox/ValidationKit/testmanager/core/testcase.py

    r96407 r97673  
    265265        The dictionary keys are ksParam_*.
    266266        """
    267         dErrors = dict()
     267        dErrors = {}
    268268
    269269        self.idTestCase         = self._validateInt(   dErrors, self.ksParam_idTestCase,        self.idTestCase);
  • trunk/src/VBox/ValidationKit/testmanager/core/testresultfailures.py

    r96407 r97673  
    455455        oData = self.getById(idTestResult)
    456456        (tsCur, tsCurMinusOne) = self._oDb.getCurrentTimestamps();
    457         if oData.tsEffective != tsCur and oData.tsEffective != tsCurMinusOne:
     457        if oData.tsEffective not in (tsCur, tsCurMinusOne):
    458458            self._historizeEntry(idTestResult, tsCurMinusOne);
    459459            self._readdEntry(uidAuthor, oData, tsCurMinusOne);
  • trunk/src/VBox/ValidationKit/testmanager/core/testset.py

    r97130 r97673  
    204204        sFile1 = os.path.join(config.g_ksFileAreaRootDir, self.sBaseFilename + '-' + sFilename);
    205205        try:
    206             oFile = open(sFile1, sMode);                        # pylint: disable=consider-using-with
     206            oFile = open(sFile1, sMode);                        # pylint: disable=consider-using-with,unspecified-encoding
    207207            return (oFile, os.fstat(oFile.fileno()).st_size, False);
    208208        except Exception as oXcpt1:
     
    240240            if not os.path.exists(os.path.dirname(sFile1)):
    241241                os.makedirs(os.path.dirname(sFile1), 0o755);
    242             oFile = open(sFile1, sMode);                        # pylint: disable=consider-using-with
     242            oFile = open(sFile1, sMode);                        # pylint: disable=consider-using-with,unspecified-encoding
    243243        except Exception as oXcpt1:
    244244            return str(oXcpt1);
  • trunk/src/VBox/ValidationKit/testmanager/core/webservergluebase.py

    r96407 r97673  
    148148        self._oDbgFile         = sys.stderr;
    149149        if config.g_ksSrvGlueDebugLogDst is not None and config.g_kfSrvGlueDebug is True:
    150             self._oDbgFile = open(config.g_ksSrvGlueDebugLogDst, 'a');  # pylint: disable=consider-using-with
     150            self._oDbgFile = open(config.g_ksSrvGlueDebugLogDst, 'a');  # pylint: disable=consider-using-with,unspecified-encoding
    151151            if config.g_kfSrvGlueCgiDumpArgs:
    152152                self._oDbgFile.write('Arguments: %s\nEnvironment:\n' % (sys.argv,));
     
    166166        # Body.
    167167        self._sBodyType = None;
    168         self._dParams = dict();
     168        self._dParams = {};
    169169        self._sHtmlBody = '';
    170170        self._cchCached = 0;
     
    192192        existing dictionary entry.
    193193        """
    194         return dict();
     194        return {};
    195195
    196196    def getClientAddr(self):
     
    433433            self._writeWorker(sBody);
    434434
    435             self._dParams = dict();
     435            self._dParams = {};
    436436            self._cchBodyWrittenOut += self._cchCached;
    437437
     
    472472
    473473        try:
    474             with open(sLogFile, 'w') as oFile:
     474            with open(sLogFile, 'w') as oFile: # pylint: disable=unspecified-encoding
    475475                oFile.write(sError + '\n\n');
    476476                if aXcptInfo[0] is not None:
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuiadminglobalrsrc.py

    r96407 r97673  
    7777        oForm = WuiHlpForm('globalresourceform',
    7878                           sFormActionUrl,
    79                            dErrors if dErrors is not None else dict())
     79                           dErrors if dErrors is not None else {})
    8080
    8181        if sAction == WuiAdmin.ksActionGlobalRsrcAdd:
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestbox.py

    r96407 r97673  
    393393            sVer1 = sOsVersion;
    394394            sVer2 = None;
    395             if oEntry.sOs == 'linux' or oEntry.sOs == 'darwin':
     395            if oEntry.sOs in ('linux', 'darwin'):
    396396                iSep = sOsVersion.find(' / ');
    397397                if iSep > 0:
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuibase.py

    r96407 r97673  
    145145        self._fDbgSqlTrace      = False;
    146146        self._fDbgSqlExplain    = False;
    147         self._dDbgParams        = dict();
     147        self._dDbgParams        = {};
    148148        for sKey, sValue in oSrvGlue.getParameters().items():
    149149            if sKey in self.kasDbgParams:
     
    322322        # Load the template.
    323323        #
    324         with open(os.path.join(self._oSrvGlue.pathTmWebUI(), self._sTemplate)) as oFile:
     324        with open(os.path.join(self._oSrvGlue.pathTmWebUI(), self._sTemplate)) as oFile: # pylint: disable=unspecified-encoding
    325325            sTmpl = oFile.read();
    326326
     
    592592            aoListOfTestCases.append(oListEntryTestCase)
    593593
    594         if aoListOfTestCases == []:
     594        if not aoListOfTestCases:
    595595            if asDefaults is None:
    596596                raise WuiException('%s is missing parameters: "%s"' % (self._sAction, sName))
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py

    r96407 r97673  
    190190        from testmanager.webui.wuiadmin import WuiAdmin;
    191191        if not dParams:
    192             dParams = dict();
     192            dParams = {};
    193193        else:
    194194            dParams = dict(dParams);
     
    205205    def __init__(self, sName, sAction, dParams = None, sConfirm = None, sTitle = None, sFragmentId = None, fBracketed = True):
    206206        if not dParams:
    207             dParams = dict();
     207            dParams = {};
    208208        else:
    209209            dParams = dict(dParams);
     
    757757        oForm = WuiHlpForm(self._sId,
    758758                           '?' + webutils.encodeUrlParams({WuiDispatcherBase.ksParamAction: self._sSubmitAction}),
    759                            dErrors if dErrors is not None else dict(),
     759                           dErrors if dErrors is not None else {},
    760760                           fReadOnly = self._sMode == self.ksMode_Show);
    761761
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuigraphwiz.py

    r96407 r97673  
    220220
    221221        # Split on unit.
    222         dUnitSeries = dict();
     222        dUnitSeries = {};
    223223        for oSeries in aoSeries:
    224224            if oSeries.iUnit not in dUnitSeries:
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuihlpform.py

    r96407 r97673  
    6969        self._fFinalized = False;
    7070        self._fReadOnly  = fReadOnly;
    71         self._dErrors    = dErrors if dErrors is not None else dict();
     71        self._dErrors    = dErrors if dErrors is not None else {};
    7272
    7373        if sOnSubmit == self.ksOnSubmit_AddReturnToFieldWithCurrentUrl:
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuihlpgraphmatplotlib.py

    r96407 r97673  
    127127        # Extract/structure the required data.
    128128        #
    129         aoSeries = list();
     129        aoSeries = [];
    130130        for j in range(len(aoTable[1].aoValues)):
    131             aoSeries.append(list());
    132         asNames  = list();
     131            aoSeries.append([]);
     132        asNames  = [];
    133133        oXRange  = numpy_arange(self._oData.getGroupCount());
    134134        fpMin = self.fpMin;
     
    156156        oSubPlot = oFigure.add_subplot(1, 1, 1);
    157157
    158         aoBars = list();
     158        aoBars = [];
    159159        for i, _ in enumerate(aoSeries):
    160160            sColor = self.calcSeriesColor(i);
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py

    r96407 r97673  
    8888        # Additional URL parameters for reports:
    8989        from testmanager.webui.wuimain import WuiMain;
    90         self._dExtraParams  = ReportFilter().strainParameters(dict() if oDisp is None else oDisp.getParameters(),
     90        self._dExtraParams  = ReportFilter().strainParameters({} if oDisp is None else oDisp.getParameters(),
    9191                                                              (WuiMain.ksParamReportPeriods,
    9292                                                               WuiMain.ksParamReportPeriodInHours,
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuitestresult.py

    r96407 r97673  
    7777    def __init__(self, sGroupedBy, idGroupMember, sName = WuiContentBase.ksShortTestResultsLink,
    7878                 dExtraParams = None, fBracketed = False):
    79         dParams = dict(dExtraParams) if dExtraParams else dict();
     79        dParams = dict(dExtraParams) if dExtraParams else {};
    8080        dParams[WuiMain.ksParamAction] = sGroupedBy;
    8181        dParams[WuiMain.ksParamGroupMemberId] = idGroupMember;
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py

    r97593 r97673  
    152152                          % (uuid.uuid4(), self.sVBoxValidationKitIso, sGaIso);
    153153            reporter.log2('Using VISO combining ValKit and GAs "%s": %s' % (sVisoContent, sGaViso));
    154             with open(sGaViso, 'w') as oGaViso:
     154            with open(sGaViso, 'w') as oGaViso: # pylint: disable=unspecified-encoding
    155155                oGaViso.write(sVisoContent);
    156156            sGaIso = sGaViso;
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r97604 r97673  
    33533353                                                         args = (oGuestProcess,),
    33543354                                                         name = ('threadForTestGuestCtrlSessionReboot'));
    3355                         oThreadReboot.setDaemon(True);
     3355                        oThreadReboot.setDaemon(True); # pylint: disable=deprecated-method
    33563356                        oThreadReboot.start();
    33573357
     
    43124312                oFile.setSize(64);
    43134313                fUseFallback = False;
    4314             except Exception as oXcpt:
     4314            except:
    43154315                reporter.logXcpt();
    43164316
     
    43234323                    try:
    43244324                        oFile.setSize(cbBigFile);
    4325                     except Exception as oXcpt:
     4325                    except Exception:
    43264326                        reporter.logXcpt('cbBigFile=%s' % (sBigPath,));
    43274327                        try:
  • trunk/src/VBox/ValidationKit/tests/api/tdPython1.py

    r96407 r97673  
    176176                try:
    177177                    oThread = threading.Thread(target=self.interruptWaitEventsThreadProc);
    178                     oThread.setDaemon(False);
     178                    oThread.setDaemon(False); # pylint: disable=deprecated-method
    179179                except:
    180180                    reporter.errorXcpt();
  • trunk/src/VBox/ValidationKit/tests/autostart/tdAutostart1.py

    r96407 r97673  
    13181318        oSet.aoTestVms.extend([oTestVm for oTestVm in self.asTestVmClasses.values() if oTestVm is not None]);
    13191319        sOs = self.getBuildOs();
    1320         if sOs in self.asTestVmClasses.keys():
     1320        if sOs in self.asTestVmClasses:
    13211321            for oTestVM in oSet.aoTestVms:
    13221322                if oTestVM is not None:
  • trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsInstOs2.py

    r96407 r97673  
    206206
    207207        # Set extra data
    208         if self.asExtraData != []:
     208        if self.asExtraData:
    209209            for sExtraData in self.asExtraData:
    210210                try:
  • trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsUnattendedInst1.py

    r96407 r97673  
    269269            eNic0AttachType = vboxcon.NetworkAttachmentType_HostOnlyNetwork;
    270270
    271         return vboxtestvms.BaseTestVm._createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage);
     271        return vboxtestvms.BaseTestVm._createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage); # pylint: disable=protected-access
    272272
    273273
     
    322322                return True;
    323323
    324         return vboxtestvms.BaseTestVm._skipVmTest(self, oTestDrv, oVM);
     324        return vboxtestvms.BaseTestVm._skipVmTest(self, oTestDrv, oVM); # pylint: disable=protected-access
     325
    325326
    326327    def getReconfiguredVm(self, oTestDrv, cCpus, sVirtMode, sParavirtMode = None):
  • trunk/src/VBox/ValidationKit/tests/storage/tdStorageRawDrive1.py

    r96407 r97673  
    10861086                    sKey = oMatch.group(1).strip();
    10871087                    sValue = oMatch.group(2).strip();
    1088                     if sKey not in asHeader.keys():
     1088                    if sKey not in asHeader:
    10891089                        return reporter.error("VMDK descriptor has invalid format");
    10901090                    sDictValue = asHeader[sKey];
     
    11221122                sKey = oMatch.group(1).strip();
    11231123                sValue = oMatch.group(2).strip();
    1124                 if sKey not in asDatabase.keys():
     1124                if sKey not in asDatabase:
    11251125                    return reporter.error("VMDK descriptor has invalid format");
    11261126                sDictValue = asDatabase[sKey];
     
    11901190                            reporter.error('Download vmdktest.vmdk from guest to host failed');
    11911191                        else:
    1192                             with open(sDstFile) as oFile:
     1192                            with open(sDstFile) as oFile: # pylint: disable=unspecified-encoding
    11931193                                asDescriptor = [row.strip() for row in oFile];
    11941194                            if not asDescriptor:
     
    15791579        oSet.aoTestVms.extend([oTestVm for oTestVm in self.asTestVmClasses.values() if oTestVm is not None]);
    15801580        sOs = self.getBuildOs();
    1581         if sOs in self.asTestVmClasses.keys():
     1581        if sOs in self.asTestVmClasses:
    15821582            for oTestVM in oSet.aoTestVms:
    15831583                if oTestVM is not None:
  • trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py

    r97488 r97673  
    11571157        # Open /dev/null for use as stdin further down.
    11581158        try:
    1159             oDevNull = open(os.path.devnull, 'w+');             # pylint: disable=consider-using-with
     1159            oDevNull = open(os.path.devnull, 'w+');             # pylint: disable=consider-using-with,unspecified-encoding
    11601160        except:
    11611161            oDevNull = None;
  • trunk/src/VBox/ValidationKit/tests/usb/usbgadget.py

    r96407 r97673  
    563563        self.aTaskArgs      = aArgs;
    564564        self.oThread        = threading.Thread(target=self.taskThread, args=(), name=('UTS-%s' % (sStatus)));
    565         self.oThread.setDaemon(True);
     565        self.oThread.setDaemon(True); # pylint: disable=deprecated-method
    566566        self.msStart        = base.timestampMilli();
    567567
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