Beispiel #1
0
 def _create_regexp(self, keyword_name):
     if variablematcher.contains_scalar_variable(keyword_name) and \
             not variablematcher.is_variable(keyword_name):
         kw = lambda: 0
         kw.arguments = None
         kw.name = keyword_name
         return EmbeddedArgsHandler(kw).name_regexp
 def _create_regexp(self, keyword_name):
     if variablematcher.contains_scalar_variable(keyword_name) and \
             not variablematcher.is_variable(keyword_name):
         kw = lambda: 0
         kw.arguments = None
         kw.name = keyword_name
         return EmbeddedArgsHandler(kw).name_regexp
Beispiel #3
0
 def OnRenameKeyword(self, event):
     old_name = self._current_cell_value()
     if not old_name.strip() or variablematcher.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())))
Beispiel #4
0
 def OnRenameKeyword(self, event):
     old_name = self._current_cell_value()
     if not old_name.strip() or variablematcher.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())))
Beispiel #5
0
 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 variablematcher.is_variable(cellvalue), cellvalue
Beispiel #6
0
 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 variablematcher.is_variable(cellvalue), cellvalue
Beispiel #7
0
 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 variablematcher.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)
Beispiel #8
0
 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 variablematcher.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)