Ejemplo n.º 1
0
def _variable_matches(selection, target):
    variable = variablematcher.get_variable_basename(selection)
    if not variable:
        return False
    variables = variablematcher.find_variable_basenames(target)
    if variable in variables:
        return True
    return _list_variable_used_as_scalar(variable, variables)
Ejemplo n.º 2
0
def _variable_matches(selection, target):
    variable = variablematcher.get_variable_basename(selection)
    if not variable:
        return False
    variables = variablematcher.find_variable_basenames(target)
    if variable in variables:
        return True
    return _list_variable_used_as_scalar(variable, variables)
Ejemplo n.º 3
0
 def __init__(self, cellvalue):
     wx.Dialog.__init__(self, None, wx.ID_ANY, "Find Where Used",
                        style=wx.DEFAULT_DIALOG_STYLE)
     self.caption = "Please select what you want to check for usage"
     variables = set(variablematcher.find_variable_basenames(cellvalue))
     self.choices = [(False, cellvalue)] + [(True, v) for v in variables]
     self.choices_string = ["Complete cell content"] + \
                           ["Variable " + var.replace("&", "&&") for var
                            in variables]
     self._build_ui()
Ejemplo n.º 4
0
 def __init__(self, cellvalue):
     wx.Dialog.__init__(self, None, wx.ID_ANY, "Find Where Used",
                        style=wx.DEFAULT_DIALOG_STYLE)
     self.caption = "Please select what you want to check for usage"
     variables = set(variablematcher.find_variable_basenames(cellvalue))
     self.choices = [(False, cellvalue)] + [(True, v) for v in variables]
     self.choices_string = ["Complete cell content"] + \
                           ["Variable " + var.replace("&", "&&") for var
                            in variables]
     self._build_ui()
Ejemplo n.º 5
0
def parse_arguments_to_var_dict(args, name):
    result = {}
    for arg in args:
        name, value = parse_argument(arg)
        if name:
            result[name] = value
    if not args and name:
        for var in variablematcher.find_variable_basenames(name):
            if variablematcher.is_scalar_variable(var):
                result[var] = None
    return result
Ejemplo n.º 6
0
def parse_arguments_to_var_dict(args, name):
    result = {}
    for arg in args:
        name, value = parse_argument(arg)
        if name:
            result[name] = value
    if not args and name:
        for var in variablematcher.find_variable_basenames(name):
            if variablematcher.is_scalar_variable(var):
                result[var] = None
    return result
Ejemplo n.º 7
0
def parse_arguments_to_var_dict(args, name):
    result = {}
    for arg in args:
        parsed = parse_argument(arg)
        if parsed:
            result[parsed[0]] = parsed[1]
    if not args and name:
        for var in variablematcher.find_variable_basenames(name):
            if variablematcher.is_scalar_variable(var):
                result[var] = None
    return result
Ejemplo n.º 8
0
 def __init__(self, cellvalue):
     wx.Dialog.__init__(self, None, wx.ID_ANY, "Find Where Used",
                        style=wx.DEFAULT_DIALOG_STYLE)
     self.caption = "Please select what you want to check for usage"
     variables = set(variablematcher.find_variable_basenames(cellvalue))
     self.choices = [(False, cellvalue)] + [(True, v) for v in variables]
     # Bug in wx.RadioBox never shows the '&' even if '&&'
     # See https://github.com/wxWidgets/Phoenix/issues/39
     self.choices_string = ["Complete cell content"] + \
                           ["Variable " + var.replace("&", "&&") for var
                            in variables]
     self._build_ui()
Ejemplo n.º 9
0
 def _cell_value_contains_multiple_search_items(self, value):
     variables = variablematcher.find_variable_basenames(value)
     return variables and variables[0] != value
Ejemplo n.º 10
0
 def _cell_value_contains_multiple_search_items(self, value):
     variables = variablematcher.find_variable_basenames(value)
     return variables and variables[0] != value