Example #1
0
 def _get_type(self, arg):
     if robotapi.is_scalar_var(arg) or robotapi.is_list_var(arg):
         return ArgumentTypes.POSITIONAL
     elif robotapi.is_scalar_var(arg.split("=")[0]) or \
             robotapi.is_dict_var(arg):
         return ArgumentTypes.NAMED
     else:
         raise ValueError
 def _get_type(self, arg):
     if robotapi.is_scalar_var(arg):
         return ArgumentTypes.SCALAR
     elif robotapi.is_scalar_var(arg.split("=")[0]):
         return ArgumentTypes.DEFAULT
     elif robotapi.is_list_var(arg):
         return ArgumentTypes.LIST
     elif robotapi.is_dict_var(arg):
         return ArgumentTypes.DICT
     else:
         raise ValueError
Example #3
0
 def _get_type(self, arg):
     if robotapi.is_scalar_var(arg):
         return ArgumentTypes.SCALAR
     elif robotapi.is_scalar_var(arg.split("=")[0]):
         return ArgumentTypes.DEFAULT
     elif robotapi.is_list_var(arg):
         return ArgumentTypes.LIST
     elif robotapi.is_dict_var(arg):
         return ArgumentTypes.DICT
     else:
         raise ValueError
Example #4
0
 def _has_list_or_dict_var_value_before(self, arg_index):
     for idx, value in enumerate(self.args):
         if idx > arg_index:
             return False
         if variablematcher.is_list_variable(value) and \
            not variablematcher.is_list_variable_subitem(value):
             return True
         if robotapi.is_dict_var(value) and \
            not variablematcher.is_dict_var_access(value):
             return True
     return False
Example #5
0
 def _has_list_or_dict_var_value_before(self, arg_index):
     for idx, value in enumerate(self.args):
         if idx > arg_index:
             return False
         if variablematcher.is_list_variable(value) and \
            not variablematcher.is_list_variable_subitem(value):
             return True
         if robotapi.is_dict_var(value) and \
            not variablematcher.is_dict_var_access(value):
             return True
     return False
Example #6
0
def parse_argument(argument):
    match = default_val_regexp.match(argument)
    if match:
        return (match.group(1), match.group(2))
    elif is_scalar_var(argument):
        return argument, ''
    elif is_list_var(argument):
        return argument, []
    elif is_dict_var(argument):
        return argument, {}
    else:
        return None, None
Example #7
0
def parse_argument(argument):
    match = default_val_regexp.match(argument)
    if match:
        return (match.group(1), match.group(2))
    elif is_scalar_var(argument):
        return argument, ''
    elif is_list_var(argument):
        return argument, []
    elif is_dict_var(argument):
        return argument, {}
    else:
        return None, None
class _DictVarValidator(object):
    __call__ = lambda self, name: is_dict_var(name)
    name = 'Dictionary'
    prefix = '&'