def __init__(self, parent, controller, tree): try: GridEditor.__init__(self, parent, len(controller.steps) + 5, max((controller.max_columns + 1), 5), parent.plugin._grid_popup_creator) self._parent = parent self._plugin = parent.plugin self._cell_selected = False self._colorizer = Colorizer(self, controller, ColorizationSettings(self._plugin.global_settings)) self._controller = controller self._configure_grid() PUBLISHER.subscribe(self._data_changed, RideItemStepsChanged) PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged) self._updating_namespace = False self._controller.datafile_controller.register_for_namespace_updates(self._namespace_updated) self._tooltips = GridToolTips(self) self._marked_cell = None self._make_bindings() self._write_steps(self._controller) self._tree = tree self._has_been_clicked = False font_size = self._plugin.global_settings.get('font size', _DEFAULT_FONT_SIZE) self.SetDefaultCellFont(wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) except Exception, e: print 'Exception in initializing KeywordEditor: %s' % e raise
def setUp(self): for listener, topic in [(self._on_keyword_added, RideUserKeywordAdded), (self._on_keyword_deleted, RideUserKeywordRemoved), (self._on_test_added, RideTestCaseAdded), (self._on_test_deleted, RideTestCaseRemoved)]: PUBLISHER.subscribe(listener, topic)
def __init__(self, parent, controller, tree): GridEditor.__init__( self, parent, len(controller.steps) + 5, max((controller.max_columns + 1), 5), parent.plugin._grid_popup_creator) self.settings = parent.plugin.global_settings['Grid'] self._parent = parent self._plugin = parent.plugin self._cell_selected = False self._colorizer = Colorizer(self, controller) self._controller = controller self._configure_grid() self._updating_namespace = False self._controller.datafile_controller.register_for_namespace_updates( self._namespace_updated) self._tooltips = GridToolTips(self) self._marked_cell = None self._make_bindings() self._write_steps(self._controller) self.autosize() self._tree = tree self._has_been_clicked = False self._counter = 0 # Workaround for double delete actions self._dcells = None # Workaround for double delete actions self._icells = None # Workaround for double insert actions PUBLISHER.subscribe(self._data_changed, RideItemStepsChanged) PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged)
def test_notifies_only_after_transaction_complete(self): datas_ok = {'steps': False, 'name': False} def name_changed_check_that_steps_have_also(data): datas_ok['steps'] = \ self.test_ctrl.step(2).keyword == UNUSED_KEYWORD_NAME def steps_changed_check_that_name_has_also(data): datas_ok['name'] = any(True for i in self.test_ctrl.datafile_controller.keywords if i.name == UNUSED_KEYWORD_NAME) PUBLISHER.subscribe(name_changed_check_that_steps_have_also, RideItemNameChanged) PUBLISHER.subscribe(steps_changed_check_that_name_has_also, RideItemStepsChanged) try: self._rename(USERKEYWORD2_NAME, UNUSED_KEYWORD_NAME, TEST1_NAME, 'Steps') finally: PUBLISHER.unsubscribe(name_changed_check_that_steps_have_also, RideItemNameChanged) PUBLISHER.unsubscribe(steps_changed_check_that_name_has_also, RideItemStepsChanged) assert_true(datas_ok['steps']) assert_true(datas_ok['name'])
def _subscribe_messages(self): for listener, topic in [(lambda msg: self.SetStatusText('Saved %s' % msg.path), RideSaved), (lambda msg: self.SetStatusText('Saved all files'), RideSaveAll), (self._set_label, RideTreeSelection), (self._show_validation_error, RideInputValidationError), (self._show_modification_prevented_error, RideModificationPrevented)]: PUBLISHER.subscribe(listener, topic)
def setUp(self): self._steps = None self._data = self._create_data() self._ctrl = testcase_controller(self, data=self._data) PUBLISHER.subscribe(self._test_changed, RideItemStepsChanged) self._orig_number_of_steps = len(self._ctrl.steps) self._number_of_test_changes = 0
def _subscribe_to_messages(self): subscriptions = [ (self._item_changed, RideItem), (self._resource_added, RideOpenResource), (self._select_resource, RideSelectResource), (self._suite_added, RideSuiteAdded), (self._keyword_added, RideUserKeywordAdded), (self._test_added, RideTestCaseAdded), (self._variable_added, RideVariableAdded), (self._leaf_item_removed, RideUserKeywordRemoved), (self._leaf_item_removed, RideTestCaseRemoved), (self._leaf_item_removed, RideVariableRemoved), (self._datafile_removed, RideDataFileRemoved), (self._datafile_set, RideDataFileSet), (self._data_dirty, RideDataChangedToDirty), (self._data_undirty, RideDataDirtyCleared), (self._variable_moved_up, RideVariableMovedUp), (self._variable_moved_down, RideVariableMovedDown), (self._variable_updated, RideVariableUpdated), (self._filename_changed, RideFileNameChanged), (self._testing_started, RideTestExecutionStarted), (self._test_result, RideTestRunning), (self._test_result, RideTestPassed), (self._test_result, RideTestFailed), (self._handle_import_setting_message, RideImportSetting), (self._mark_excludes, RideExcludesChanged), (self._mark_excludes, RideIncludesChanged), ] for listener, topic in subscriptions: PUBLISHER.subscribe(listener, topic)
def __init__(self, parent, controller, tree): try: GridEditor.__init__( self, parent, len(controller.steps) + 5, max((controller.max_columns + 1), 5), parent.plugin._grid_popup_creator, ) self._parent = parent self._plugin = parent.plugin self._cell_selected = False self._colorizer = Colorizer(self, controller, ColorizationSettings(self._plugin.global_settings)) self._controller = controller self._configure_grid() PUBLISHER.subscribe(self._data_changed, RideItemStepsChanged) PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged) self._controller.datafile_controller.register_for_namespace_updates(self._namespace_updated) self._tooltips = GridToolTips(self) self._marked_cell = None self._make_bindings() self._write_steps(self._controller) self._tree = tree self._has_been_clicked = False except Exception, e: print "Exception in initializing KeywordEditor: %s" % e raise
def __init__(self): self.datafiles = None self.componentChangeImpact = dict() self.user_def_keyword = dict() self.userKeywordObject = list() self.threshold = 3 PUBLISHER.subscribe(self.set_duplicated_detection_threshold, SettingDuplicatedDetectionThreshold)
def __init__(self, settings): self._settings = settings self._library_manager = None self._content_assist_hooks = [] self._update_listeners = set() self._init_caches() self._set_pythonpath() PUBLISHER.subscribe(self._setting_changed, RideSettingsChanged)
def setUp(self): class Data(object): source = directory = None self.ctrl = TestCaseFileController(Data()) self._has_unsaved_changes = False self._saved = False self.messages = [(self._changes, RideDataChangedToDirty), (self._cleared, RideDataDirtyCleared)] for listener, topic in self.messages: PUBLISHER.subscribe(listener, topic)
def __init__(self, editor, settings): self.editor = editor self.lexer = None self.settings = settings if robotframeworklexer: self.lexer = robotframeworklexer.RobotFrameworkLexer() self._set_styles() else: self.editor.GetParent().create_syntax_colorization_help() PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged)
def _subscribe_messages(self): for listener, topic in [ (lambda msg: self.SetStatusText('Saved %s' % msg.path), RideSaved), (lambda msg: self.SetStatusText('Saved all files'), RideSaveAll), (self._set_label, RideTreeSelection), (self._show_validation_error, RideInputValidationError), (self._show_modification_prevented_error, RideModificationPrevented) ]: PUBLISHER.subscribe(listener, topic)
def setUp(self): self.test_ctrl, self.namespace = TestCaseControllerWithSteps() self._steps_have_changed = False self._testcase_settings_have_changed = False self._name_has_changed = False self._listeners_and_topics = [(self._steps_changed, RideItemStepsChanged), (self._testcase_settings_changed, RideItemSettingsChanged), (self._name_changed, RideItemNameChanged)] for listener, topic in self._listeners_and_topics: PUBLISHER.subscribe(listener, topic)
def subscribe(self, listener, *topics): """Start to listen to messages with the given ``topics``. See the documentation of the `robotide.publish` module for more information about subscribing to messages and the messaging system `unsubscribe` and `unsubscribe_all` can be used to stop listening to certain or all messages. """ for topic in topics: PUBLISHER.subscribe(listener, topic)
def subscribe(self, listener, *topics): """Start to listen to messages with the given ``topics``. See the documentation of the `robotide.publish` module for more information about subscribing to messages and the messaging system `unsubscribe` and `unsubscribe_all` can be used to stop listening to certain or all messages. """ for topic in topics: PUBLISHER.subscribe(listener, topic, key=self)
def __init__(self, editor, settings, readonly=False): self.editor = editor self.lexer = None self.settings = settings self._readonly = readonly self._ensure_default_font_is_valid() if robotframeworklexer: self.lexer = robotframeworklexer.RobotFrameworkLexer() else: self.editor.GetParent().create_syntax_colorization_help() self._set_styles(self._readonly) PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged)
def _subscribe_messages(self): for listener, topic in [ (lambda msg: self.SetStatusText('Saved %s' % msg.path), RideSaved), (lambda msg: self.SetStatusText('Saved all files'), RideSaveAll), (self._set_label, RideTreeSelection), (self._show_validation_error, RideInputValidationError), (self._show_modification_prevented_error, RideModificationPrevented), (self._load_datafile_finish, RideLoadDatafileFinish), (self._generate_specific_graph, GenerateSpecificGraph), (self._generate_changed_impact_graph, GenerateChangedImpactGraph) ]: PUBLISHER.subscribe(listener, topic)
def __init__(self, parent, title, data_validator): wx.Panel.__init__(self, parent) self._syntax_colorization_help_exists = False self._data_validator = data_validator self._data_validator.set_editor(self) self._parent = parent self._tab_size = self._parent._app.settings.get( 'txt number of spaces', 4) self._create_ui(title) self._data = None self._dirty = False self._positions = {} PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged)
def __init__(self, parent, controller, tree): GridEditor.__init__(self, parent, len(controller.steps) + 5, max((controller.max_columns + 1), 5), parent.plugin._grid_popup_creator) self.settings = parent.plugin.global_settings['Grid'] self._parent = parent self._plugin = parent.plugin self._cell_selected = False self._colorizer = Colorizer(self, controller) self._controller = controller self._configure_grid() self._updating_namespace = False self._controller.datafile_controller.register_for_namespace_updates( self._namespace_updated) self._tooltips = GridToolTips(self) self._marked_cell = None self._make_bindings() self._write_steps(self._controller) self.autosize() self._tree = tree self._has_been_clicked = False self._counter = 0 # Workaround for double delete actions self._dcells = None # Workaround for double delete actions self._icells = None # Workaround for double insert actions PUBLISHER.subscribe(self._before_saving, RideBeforeSaving) PUBLISHER.subscribe(self._data_changed, RideItemStepsChanged) PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged) PUBLISHER.subscribe(self._ps_on_resize_grid, RideSaved)
def test_notifies_only_after_transaction_complete(self): datas_ok = {'steps':False, 'name':False} def name_changed_check_that_steps_have_also(data): datas_ok['steps'] = self.test_ctrl.step(2).keyword == UNUSED_KEYWORD_NAME def steps_changed_check_that_name_has_also(data): datas_ok['name'] = any(True for i in self.test_ctrl.datafile_controller.keywords if i.name == UNUSED_KEYWORD_NAME) PUBLISHER.subscribe(name_changed_check_that_steps_have_also, RideItemNameChanged) PUBLISHER.subscribe(steps_changed_check_that_name_has_also, RideItemStepsChanged) try: self._rename(USERKEYWORD2_NAME, UNUSED_KEYWORD_NAME, TEST1_NAME, 'Steps') finally: PUBLISHER.unsubscribe(name_changed_check_that_steps_have_also, RideItemNameChanged) PUBLISHER.unsubscribe(steps_changed_check_that_name_has_also, RideItemStepsChanged) assert_true(datas_ok['steps']) assert_true(datas_ok['name'])
def __init__(self, parent, tree, controller): PUBLISHER.subscribe( self._update_vars, 'ride.variable.added', key=self) PUBLISHER.subscribe( self._update_vars, 'ride.variable.updated', key=self) PUBLISHER.subscribe( self._update_vars, 'ride.variable.removed', key=self) PUBLISHER.subscribe(self._open_variable_dialog, RideOpenVariableDialog) _AbstractListEditor.__init__(self, parent, tree, controller)
def __init__(self, parent, title, data_validator): wx.Panel.__init__(self, parent) self._syntax_colorization_help_exists = False self._data_validator = data_validator self._data_validator.set_editor(self) self._parent = parent self._title = title self._tab_size = self._parent._app.settings.get( 'txt number of spaces', 4) self._create_ui(title) self._data = None self._dirty = False self._position = None self._showing_list = False self._tab_open = None # self._autocomplete = None PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged) PUBLISHER.subscribe(self.OnTabChange, RideNotebookTabChanging)
def _subscribe_to_messages(self): subscriptions = [ (self._item_changed, RideItem), (self._resource_added, RideOpenResource), (self._select_resource, RideSelectResource), (self._suite_added, RideSuiteAdded), (self._keyword_added, RideUserKeywordAdded), (self._test_added, RideTestCaseAdded), (self._variable_added, RideVariableAdded), (self._leaf_item_removed, RideUserKeywordRemoved), (self._leaf_item_removed, RideTestCaseRemoved), (self._leaf_item_removed, RideVariableRemoved), (self._datafile_removed, RideDataFileRemoved), (self._datafile_set, RideDataFileSet), (self._data_dirty, RideDataChangedToDirty), (self._data_undirty, RideDataDirtyCleared), (self._variable_moved_up, RideVariableMovedUp), (self._variable_moved_down, RideVariableMovedDown), (self._variable_updated, RideVariableUpdated), (self._filename_changed, RideFileNameChanged), ] for listener, topic in subscriptions: PUBLISHER.subscribe(listener, topic)
def __init__(self, parent, controller, tree): GridEditor.__init__(self, parent, len(controller.steps) + 5, max((controller.max_columns + 1), 5), parent.plugin._grid_popup_creator, parent.plugin.global_settings['Grid']) self._parent = parent self._plugin = parent.plugin self._cell_selected = False self._colorizer = Colorizer(self, controller) self._controller = controller self._configure_grid() self._updating_namespace = False self._controller.datafile_controller.register_for_namespace_updates( self._namespace_updated) self._tooltips = GridToolTips(self) self._marked_cell = None self._make_bindings() self._write_steps(self._controller) self._tree = tree self._has_been_clicked = False PUBLISHER.subscribe(self._data_changed, RideItemStepsChanged) PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged)
def bind_event(self): PUBLISHER.subscribe(self.tree_selected_item_changed, MyTreeSelectedItemChanged) PUBLISHER.subscribe(self.load_datafiles, DuplicateDetection) PUBLISHER.subscribe(self.set_all_label, MyTreeBuildFinish)
def _create_test_selection_controller(self): tsc = TestSelectionController() PUBLISHER.subscribe(tsc.clear_all, RideOpenSuite) PUBLISHER.subscribe(tsc.clear_all, RideNewProject) return tsc
def setUp(self): PUBLISHER.subscribe(self._file_name_changed, RideFileNameChanged, "TestRenameTestCaseFile") PUBLISHER.subscribe(self._file_name_error, RideInputValidationError, "TestRenameTestCaseFile") self._clean_test_files(["quux.txt", "some.txt"])
def bind_event(self): PUBLISHER.subscribe(self.load_data, MyDynamicAnalyzerBuildFinish)
def _bind_tree_events(self): self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick) PUBLISHER.subscribe(self.build_node_dict, DuplicateDetection)
def setUp(self): _DataDependentTest.setUp(self) PUBLISHER.subscribe(self._datafile_removed, RideDataFileRemoved)
def __init__(self, topic): PUBLISHER.subscribe(self._listener, topic, self) self._topic = topic self.data = [] self.outer_listener = lambda message: 0
def __init__(self, editor, settings): self.editor = editor self.settings = settings._config_obj['Plugins']['Test Runner'] self._ensure_default_font_is_valid() self._set_styles() PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged)
def enable(self): self.register_action(ActionInfo('Tools', self.HEADER, self.execute_spec_import, position=83)) PUBLISHER.subscribe(self.execute_spec_import, RideExecuteSpecXmlImport)
def _subscribe(self): PUBLISHER.subscribe(self._test_name_changed, RideItemNameChanged) PUBLISHER.subscribe(self._suite_name_changed, RideFileNameChanged)
def setUp(self): PUBLISHER.subscribe(self._file_name_changed, RideFileNameChanged)
def setUp(self): self._controller = _Controller() self._reset_command() PUBLISHER.subscribe(self._modification_prevented, RideModificationPrevented)
def __init__(self, editor, settings): self.editor = editor self.settings = settings self._set_styles() PUBLISHER.subscribe(self.OnSettingsChanged, RideSettingsChanged)
def __init__(self, controller, tree, node, settings): _TestOrUserKeywordHandler.__init__(self, controller, tree, node, settings) PUBLISHER.subscribe(self.test_selection_changed, RideTestSelectedForRunningChanged)
def setUp(self): self.ctrl = testcase_controller() PUBLISHER.subscribe(self._test_renamed, RideItemNameChanged)
def __init__(self, topic): PUBLISHER.subscribe(self._listener, topic, self) self._topic = topic self.data = []
def setUp(self): PUBLISHER.subscribe(self._file_name_changed, RideFileNameChanged, "TestRenameTestCaseFile") PUBLISHER.subscribe(self._file_name_error, RideInputValidationError, "TestRenameTestCaseFile") self._clean_test_files(["quux.txt","some.txt"])
def enable(self): self.register_action(ActionInfo('Tools', self.HEADER, self.execute_spec_import, position=83)) PUBLISHER.subscribe(self._ps_on_execute_spec_import, RideExecuteSpecXmlImport)