(self, value)
Validate and set a WMI provider. Default to `ProviderArchitecture.DEFAULT`
Validate and set a WMI provider. Default to `ProviderArchitecture.DEFAULT`
Validate and set a WMI provider . Default to ProviderArchitecture . DEFAULT
def provider(self, value):
        """
        Validate and set a WMI provider. Default to `ProviderArchitecture.DEFAULT`
        """
        result = None

        # `None` defaults to `ProviderArchitecture.DEFAULT`
        defaulted_value = value or ProviderArchitecture.DEFAULT

        try:
            parsed_value = int(defaulted_value)
        except ValueError:
            pass
        else:
            if parsed_value in ProviderArchitecture:
                result = parsed_value

        if result is None:
            self.logger.error(u"Invalid '%s' WMI Provider Architecture. The parameter is ignored.", value)

        self._provider = result or ProviderArchitecture.DEFAULT
def provider ( self , value ) : result = None # `None` defaults to `ProviderArchitecture.DEFAULT` defaulted_value = value or ProviderArchitecture . DEFAULT try : parsed_value = int ( defaulted_value ) except ValueError : pass else : if parsed_value in ProviderArchitecture : result = parsed_value if result is None : self . logger . error ( u"Invalid '%s' WMI Provider Architecture. The parameter is ignored." , value ) self . _provider = result or ProviderArchitecture . DEFAULT