def OnClose(self, event): if self._allowed_to_exit(): PUBLISHER.unsubscribe(self._set_label, RideTreeSelection) RideClosing().publish() self.Destroy() else: wx.CloseEvent.Veto(event)
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 OnClose(self, event): if self._allowed_to_exit(): PUBLISHER.unsubscribe(self._set_label, RideTreeSelection) RideClosing().publish() self.Destroy() else: wx.CloseEvent.Veto(event)
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 close(self): self._colorizer.close() self.save() PUBLISHER.unsubscribe(self._data_changed, RideItemStepsChanged) if self._namespace_updated: #Prevent re-entry to unregister method self._controller.datafile_controller.unregister_namespace_updates(self._namespace_updated) self._namespace_updated = None
def OnClose(self, event): self._application.settings['mainframe size'] = self.GetSizeTuple() self._application.settings['mainframe position'] = self.GetPositionTuple() if self._allowed_to_exit(): PUBLISHER.unsubscribe(self._set_label, RideTreeSelection) RideClosing().publish() self.Destroy() else: wx.CloseEvent.Veto(event)
def OnClose(self, event): if self._allowed_to_exit(): PUBLISHER.unsubscribe(self._set_label, RideTreeSelection) RideClosing().publish() # deinitialize the frame manager self._mgr.UnInit() self.Destroy() else: wx.CloseEvent.Veto(event)
def OnClose(self, event): self._application.settings['mainframe size'] = self.GetSizeTuple() self._application.settings['mainframe position'] = self.GetPositionTuple() if self._allowed_to_exit(): PUBLISHER.unsubscribe(self._set_label, RideTreeSelection) RideClosing().publish() self.Destroy() else: wx.CloseEvent.Veto(event)
def OnClose(self, event): if self._allowed_to_exit(): PUBLISHER.unsubscribe(self._set_label, RideTreeSelection) RideClosing().publish() # deinitialize the frame manager self._mgr.UnInit() self.Destroy() else: wx.CloseEvent.Veto(event)
def close(self): self._colorizer.close() self.save() PUBLISHER.unsubscribe(self._data_changed, RideItemStepsChanged) if self._namespace_updated: #Prevent re-entry to unregister method self._controller.datafile_controller.unregister_namespace_updates( self._namespace_updated) self._namespace_updated = None
def unsubscribe(self, listener, *topics): """Stops listening to messages with the given ``topics``. ``listener`` and ``topics`` have the same meaning as in `subscribe` and a listener/topic combination is unsubscribed only when both of them match. """ for topic in topics: PUBLISHER.unsubscribe(listener, topic)
def unsubscribe(self, listener, *topics): """Stops listening to messages with the given ``topics``. ``listener`` and ``topics`` have the same meaning as in `subscribe` and a listener/topic combination is unsubscribed only when both of them match. """ for topic in topics: PUBLISHER.unsubscribe(listener, topic, key=self)
def OnClose(self, event): if self._allowed_to_exit(): perspective = self._mgr.SavePerspective() self._application.settings.set('AUI Perspective', perspective) PUBLISHER.unsubscribe(self._set_label, RideTreeSelection) RideClosing().publish() # deinitialize the frame manager self._mgr.UnInit() self.Destroy() else: wx.CloseEvent.Veto(event)
def OnClose(self, event): if self._allowed_to_exit(): perspective = self._mgr.SavePerspective() self._application.settings.set('AUI Perspective', perspective) PUBLISHER.unsubscribe(self._set_label, RideTreeSelection) RideClosing().publish() # deinitialize the frame manager self._mgr.UnInit() self._task_bar_icon.Destroy() self.Destroy() app = wx.GetApp() if app is not self._application: # other wx app instance created unexpectedly # this will cause RIDE app instance cannot invoke ExitMainLoop properly self._application.ExitMainLoop() else: wx.CloseEvent.Veto(event)
def unsubscribe(self): PUBLISHER.unsubscribe(self._listener, self._topic, self)
def close(self): self._colorizer.close() self.save() PUBLISHER.unsubscribe(self._data_changed, RideItemStepsChanged)
def tearDown(self): _DataDependentTest.tearDown(self) PUBLISHER.unsubscribe(self._datafile_removed, RideDataFileRemoved)
def tearDown(self): PUBLISHER.unsubscribe(self._test_changed, RideItemStepsChanged)
def tearDown(self): for listener, topic in self._listeners_and_topics: PUBLISHER.unsubscribe(listener, topic)
def tearDown(self): PUBLISHER.unsubscribe(self._file_name_changed, RideFileNameChanged)
def tearDown(self): for listener, topic in self.messages: PUBLISHER.unsubscribe(listener, topic) if os.path.exists('path'): shutil.rmtree('path')
def tearDown(self): PUBLISHER.unsubscribe(self._test_changed, RideItemStepsChanged)
def tearDown(self): _DataDependentTest.tearDown(self) PUBLISHER.unsubscribe(self._datafile_removed, RideDataFileRemoved)
def tearDown(self): PUBLISHER.unsubscribe(self._modification_prevented, RideModificationPrevented)
def tearDown(self): for listener, topic in self._listeners_and_topics: PUBLISHER.unsubscribe(listener, topic)
def unsubscribe(self): PUBLISHER.unsubscribe(self._listener, self._topic, self)
def tearDown(self): if os.path.exists('path'): os.removedirs('path') PUBLISHER.unsubscribe(self._test_changed, RideItemStepsChanged)
def tearDown(self): if os.path.exists('path'): os.removedirs('path') PUBLISHER.unsubscribe(self._test_changed, RideItemStepsChanged)
def tearDown(self): for listener, topic in self.messages: PUBLISHER.unsubscribe(listener, topic) if os.path.exists('path'): shutil.rmtree('path')
def tearDown(self): PUBLISHER.unsubscribe(self._test_renamed, RideItemNameChanged)
def tearDown(self): PUBLISHER.unsubscribe(self._modification_prevented, RideModificationPrevented)