VirtualBox

Changeset 82641 in vbox


Ignore:
Timestamp:
Dec 22, 2019 10:04:36 PM (5 years ago)
Author:
vboxsync
Message:

TestManager/base.py: Added a strainParameters method to the filter base class to help making links that passes along relevant filter settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/core/base.py

    r79087 r82641  
    12841284        return self;
    12851285
     1286    def strainParameters(self, dParams, aAdditionalParams = None):
     1287        """ Filters just the parameters relevant to this filter, returning a copy. """
     1288
     1289        # Collect the parameter names.
     1290        dWanted = dict();
     1291        for oCrit in self.aCriteria:
     1292            dWanted[oCrit.sVarNm] = 1;
     1293            if oCrit.sInvVarNm:
     1294                dWanted[oCrit.sInvVarNm] = 1;
     1295
     1296        # Add additional stuff.
     1297        if aAdditionalParams:
     1298            for sParam in aAdditionalParams:
     1299                dWanted[sParam] = 1;
     1300
     1301        # To the straining.
     1302        dRet = dict();
     1303        for sKey in dParams:
     1304            if sKey in dWanted:
     1305                dRet[sKey] = dParams[sKey];
     1306        return dRet;
     1307
    12861308
    12871309class ModelLogicBase(ModelBase): # pylint: disable=too-few-public-methods
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