本文整理匯總了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)
示例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]
示例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)
示例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)