Exemple #1
0
 def _as_operator(self, operator_or_code, default_operator):
     if operator_or_code == None:
         return default_operator
     if not is_subclass_of(operator_or_code, NexposeCriteriaOperator):
         operator_or_code = GetOperatorByCode(operator_or_code)
     assert is_subclass_of(operator_or_code, AND) or is_subclass_of(
         operator_or_code, OR)
     return operator_or_code
Exemple #2
0
 def __init__(self, field, operator, value=None):
     assert is_subclass_of(field, NexposeCriteriaField)
     assert is_subclass_of(operator, NexposeCriteriaOperator)
     assert operator in field.ValidOperators
     if is_subclass_of(value, NexposeCriteriaConstant):
         value = NexposeCriteriaConstant.Value
     self.field = field
     self.operator = operator
     self.value = value if value != None else ''
def _get_filtered_classes(required_class):
    _all_uppercase_variables = [
        _get_by_name(name) for name in _all_uppercase_names
    ]
    return [
        variable for variable in _all_uppercase_variables
        if is_subclass_of(variable, required_class)
    ]
Exemple #4
0
def GetSupportedCredentials():
    this_module = sys.modules[__name__]
    credentials = [
        this_module.__dict__[name] for name in dir(this_module)
        if is_subclass_of(this_module.__dict__[name], Credential)
    ]
    for credential in credentials:
        if credential.SERVICE_TYPE:
            yield credential
Exemple #5
0
def _get_filtered_classes(required_class):
    _all_uppercase_variables = map(lambda name: _get_by_name(name),
                                   _all_uppercase_names)
    return filter(lambda variable: is_subclass_of(variable, required_class),
                  _all_uppercase_variables)