VirtualBox

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/testdriver
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 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;
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