def OnRenameKeyword(self, event): old_name = self._current_cell_value() if not old_name.strip() or is_variable(old_name): return new_name = wx.GetTextFromUser("New name", "Rename Keyword", default_value=old_name) if new_name: self._execute(RenameKeywordOccurrences(old_name, new_name, RenameProgressObserver(self.GetParent())))
def _create_regexp(self, keyword_name): if contains_scalar_variable( keyword_name) and not is_variable(keyword_name): kw = lambda: 0 kw.arguments = None kw.name = keyword_name return EmbeddedArgsHandler(kw).name_regexp
def _get_is_variable_and_searchstring(self): cellvalue = self.GetCellValue(*self.selection.cells()[0]) if self._cell_value_contains_multiple_search_items(cellvalue): choice_dialog = ChooseUsageSearchStringDialog(cellvalue) choice_dialog.ShowModal() is_var, value = choice_dialog.GetStringSelection() choice_dialog.Destroy() return is_var, value else: return utils.is_variable(cellvalue), cellvalue
def OnRenameKeyword(self, event): old_name = self._current_cell_value() if not old_name.strip() or is_variable(old_name): return new_name = wx.GetTextFromUser('New name', 'Rename Keyword', default_value=old_name) if new_name: self._execute( RenameKeywordOccurrences( old_name, new_name, RenameProgressObserver(self.GetParent())))
def _get_content_with_type(self, col, position): value = self.get_value(col) if self._is_commented(col): return CellContent(ContentType.COMMENTED, value) if self._get_last_none_empty_col_idx() < col: return CellContent(ContentType.EMPTY, value) if utils.is_variable(value): if self._is_unknow_variable(value, position): return CellContent(ContentType.UNKNOWN_VARIABLE, value) return CellContent(ContentType.VARIABLE, value) if self.is_user_keyword(value): return CellContent(ContentType.USER_KEYWORD, value, self.get_keyword_info(value).source) if self.is_library_keyword(value): return CellContent(ContentType.LIBRARY_KEYWORD, value, self.get_keyword_info(value).source) return CellContent(ContentType.STRING, value)
def OnFindWhereUsed(self, event): cellvalue = self.GetCellValue(*self.selection.cells()[0]) searchstring = None if self._cell_value_contains_multiple_search_items(cellvalue): choice_dialog = ChooseUsageSearchStringDialog(cellvalue) if choice_dialog.ShowModal() == wx.ID_OK: searchstring = choice_dialog.GetStringSelection() choice_dialog.Destroy() else: searchstring = cellvalue if searchstring: if utils.is_variable(searchstring): VariableUsages(self._controller, self._tree.highlight, searchstring).show() else: Usages(self._controller, self._tree.highlight, searchstring).show()
def _create_regexp(self, keyword_name): if contains_scalar_variable(keyword_name) and not is_variable(keyword_name): kw = lambda: 0 kw.arguments = None kw.name = keyword_name return EmbeddedArgsHandler(kw).name_regexp