• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python publish.PUBLISHER类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中robotide.publish.PUBLISHER的典型用法代码示例。如果您正苦于以下问题:Python PUBLISHER类的具体用法?Python PUBLISHER怎么用?Python PUBLISHER使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了PUBLISHER类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _subscribe_messages

 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)
开发者ID:Trustmania,项目名称:RIDE,代码行数:7,代码来源:mainframe.py


示例2: __init__

 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
开发者ID:Acidburn0zzz,项目名称:RIDE,代码行数:27,代码来源:kweditor.py


示例3: _subscribe_to_messages

 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)
开发者ID:liuwenf110,项目名称:RIDE,代码行数:30,代码来源:tree.py


示例4: OnClose

 def OnClose(self, event):
     if self._allowed_to_exit():
         PUBLISHER.unsubscribe(self._set_label, RideTreeSelection)
         RideClosing().publish()
         self.Destroy()
     else:
         wx.CloseEvent.Veto(event)
开发者ID:dasituzi,项目名称:RIDE,代码行数:7,代码来源:mainframe.py


示例5: __init__

 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
开发者ID:blueenergy,项目名称:RIDE,代码行数:27,代码来源:kweditor.py


示例6: setUp

 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)
开发者ID:Garjy,项目名称:RIDE,代码行数:7,代码来源:test_macro_commands.py


示例7: setUp

 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
开发者ID:Acidburn0zzz,项目名称:RIDE,代码行数:7,代码来源:base_command_test.py


示例8: __init__

    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)
开发者ID:robotframework,项目名称:RIDE,代码行数:28,代码来源:kweditor.py


示例9: close

 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
开发者ID:Hariprasad-ka,项目名称:RIDE,代码行数:8,代码来源:kweditor.py


示例10: __init__

 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)
开发者ID:pskpg86,项目名称:RIDE,代码行数:8,代码来源:namespace.py


示例11: __init__

    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)
开发者ID:mypstom,项目名称:robotide,代码行数:8,代码来源:DDT.py


示例12: OnClose

 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)
开发者ID:HelioGuilherme66,项目名称:RIDE,代码行数:9,代码来源:mainframe.py


示例13: OnClose

 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)
开发者ID:yanne,项目名称:RIDE,代码行数:9,代码来源:mainframe.py


示例14: unsubscribe

    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)
开发者ID:EnochManohar,项目名称:RIDE,代码行数:9,代码来源:plugin.py


示例15: publish

    def publish(self, topic, data):
        """Publishes a message with given topic and client data.

        Purpose of this method is to support inter-plugin communication which
        is not possible to achieve using custom message classes.

        `data` will be passed as an argument to registered listener methods.
        """
        PUBLISHER.publish(topic, data)
开发者ID:EnochManohar,项目名称:RIDE,代码行数:9,代码来源:plugin.py


示例16: setUp

 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)
开发者ID:pskpg86,项目名称:RIDE,代码行数:10,代码来源:test_occurrences.py


示例17: setUp

 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)
开发者ID:Garjy,项目名称:RIDE,代码行数:10,代码来源:test_filecontrollers.py


示例18: subscribe

    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)
开发者ID:EnochManohar,项目名称:RIDE,代码行数:11,代码来源:plugin.py


示例19: _subscribe_messages

 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)
开发者ID:mypstom,项目名称:robotide,代码行数:12,代码来源:mainframe.py


示例20: test_notifies_only_after_transaction_complete

    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'])
开发者ID:HelioGuilherme66,项目名称:RIDE,代码行数:25,代码来源:test_occurrences.py



注:本文中的robotide.publish.PUBLISHER类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python widgets.Dialog类代码示例发布时间:2022-05-26
下一篇:
Python pluginapi.Plugin类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap