示例#1
0
 def OnClose(self, event):
     if self._allowed_to_exit():
         PUBLISHER.unsubscribe(self._set_label, RideTreeSelection)
         RideClosing().publish()
         self.Destroy()
     else:
         wx.CloseEvent.Veto(event)
示例#2
0
    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'])
示例#3
0
 def OnClose(self, event):
     if self._allowed_to_exit():
         PUBLISHER.unsubscribe(self._set_label, RideTreeSelection)
         RideClosing().publish()
         self.Destroy()
     else:
         wx.CloseEvent.Veto(event)
示例#4
0
    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'])
示例#5
0
 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
示例#6
0
文件: mainframe.py 项目: ratlsun/RIDE
 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)
示例#7
0
 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)
示例#8
0
文件: mainframe.py 项目: yanne/RIDE
 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)
示例#9
0
 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
示例#11
0
    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)
示例#12
0
    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)
示例#13
0
 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)
示例#14
0
 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)
示例#15
0
 def unsubscribe(self):
     PUBLISHER.unsubscribe(self._listener, self._topic, self)
示例#16
0
文件: kweditor.py 项目: nbbull/RIDE
 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)
示例#18
0
 def tearDown(self):
     PUBLISHER.unsubscribe(self._test_changed, RideItemStepsChanged)
示例#19
0
 def tearDown(self):
     for listener, topic in self._listeners_and_topics:
         PUBLISHER.unsubscribe(listener, topic)
示例#20
0
 def tearDown(self):
     PUBLISHER.unsubscribe(self._file_name_changed, RideFileNameChanged)
示例#21
0
 def tearDown(self):
     for listener, topic in self.messages:
         PUBLISHER.unsubscribe(listener, topic)
     if os.path.exists('path'):
         shutil.rmtree('path')
示例#22
0
 def tearDown(self):
     PUBLISHER.unsubscribe(self._test_changed, RideItemStepsChanged)
示例#23
0
 def tearDown(self):
     _DataDependentTest.tearDown(self)
     PUBLISHER.unsubscribe(self._datafile_removed, RideDataFileRemoved)
 def tearDown(self):
     PUBLISHER.unsubscribe(self._modification_prevented,
                           RideModificationPrevented)
示例#25
0
 def tearDown(self):
     for listener, topic in self._listeners_and_topics:
         PUBLISHER.unsubscribe(listener, topic)
示例#26
0
文件: mocks.py 项目: tbener/RIDE
 def unsubscribe(self):
     PUBLISHER.unsubscribe(self._listener, self._topic, self)
示例#27
0
 def tearDown(self):
     if os.path.exists('path'):
         os.removedirs('path')
     PUBLISHER.unsubscribe(self._test_changed, RideItemStepsChanged)
示例#28
0
 def tearDown(self):
     if os.path.exists('path'):
         os.removedirs('path')
     PUBLISHER.unsubscribe(self._test_changed, RideItemStepsChanged)
示例#29
0
 def tearDown(self):
     for listener, topic in self.messages:
         PUBLISHER.unsubscribe(listener, topic)
     if os.path.exists('path'):
         shutil.rmtree('path')
示例#30
0
 def tearDown(self):
     PUBLISHER.unsubscribe(self._test_renamed, RideItemNameChanged)
 def tearDown(self):
     PUBLISHER.unsubscribe(self._modification_prevented, RideModificationPrevented)