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 = utils.find_variable_basenames(cellvalue) self.choices = [cellvalue] + variables self.choices_string = ["Complete cell content"] + ["Variable " + var for var in variables] self._build_ui()
def _variable_matches(selection, target): variable = get_variable_basename(selection) if not variable: return False variables = find_variable_basenames(target) if variable in variables: return True return _list_variable_used_as_scalar(variable, variables)
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 = utils.find_variable_basenames(cellvalue) self.choices = [(False, cellvalue)] + [(True, v) for v in variables] self.choices_string = ["Complete cell content"] + \ ["Variable " + var for var in variables] self._build_ui()
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 find_variable_basenames(name): if is_scalar_variable(var): result[var] = None return result
def _cell_value_contains_multiple_search_items(self, value): variables = utils.find_variable_basenames(value) return variables and variables[0] != value
def _contains_item(self, item): if len(utils.find_variable_basenames(self._keyword_name)) > 0: return self._contains_variable(item) else: return self._contains_keyword(item)