當前位置: 首頁>>代碼示例>>Python>>正文


Python Reactor.current_instance方法代碼示例

本文整理匯總了Python中pybuilder.reactor.Reactor.current_instance方法的典型用法代碼示例。如果您正苦於以下問題:Python Reactor.current_instance方法的具體用法?Python Reactor.current_instance怎麽用?Python Reactor.current_instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pybuilder.reactor.Reactor的用法示例。


在下文中一共展示了Reactor.current_instance方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setUp

# 需要導入模塊: from pybuilder.reactor import Reactor [as 別名]
# 或者: from pybuilder.reactor.Reactor import current_instance [as 別名]
 def setUp(self):
     self.old_reactor = Reactor.current_instance()
     self.plugin_loader_mock = Mock(PluginLoader)
     self.logger = Mock()
     self.execution_manager = Mock(ExecutionManager)
     self.reactor = Reactor(
         self.logger, self.execution_manager, self.plugin_loader_mock)
開發者ID:wenlien,項目名稱:pybuilder,代碼行數:9,代碼來源:reactor_tests.py

示例2: get_all_dependencies_for_task

# 需要導入模塊: from pybuilder.reactor import Reactor [as 別名]
# 或者: from pybuilder.reactor.Reactor import current_instance [as 別名]
def get_all_dependencies_for_task(task):
    """
    Returns a list containing all tasks required by the given
    task function (but not the given task itself)
    """
    from pybuilder.reactor import Reactor
    task_name = task.__name__
    execution_manager = Reactor.current_instance().execution_manager
    task_and_all_dependencies = execution_manager.collect_all_transitive_tasks([task_name])
    return [dependency for dependency in task_and_all_dependencies if dependency.name != task_name]
開發者ID:010110101001,項目名稱:pybuilder,代碼行數:12,代碼來源:utils.py

示例3: use_plugin

# 需要導入模塊: from pybuilder.reactor import Reactor [as 別名]
# 或者: from pybuilder.reactor.Reactor import current_instance [as 別名]
def use_plugin(name, version=None, plugin_module_name=None):
    from pybuilder.reactor import Reactor
    reactor = Reactor.current_instance()
    if reactor is not None:
        reactor.require_plugin(name, version, plugin_module_name)
開發者ID:0xD3ADB33F,項目名稱:pybuilder,代碼行數:7,代碼來源:core.py

示例4: use_plugin

# 需要導入模塊: from pybuilder.reactor import Reactor [as 別名]
# 或者: from pybuilder.reactor.Reactor import current_instance [as 別名]
def use_plugin(name):
    from pybuilder.reactor import Reactor

    reactor = Reactor.current_instance()
    if reactor is not None:
        reactor.require_plugin(name)
開發者ID:jewishjeff,項目名稱:pybuilder,代碼行數:8,代碼來源:core.py


注:本文中的pybuilder.reactor.Reactor.current_instance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。