本文整理汇总了Python中pants.option.global_options.GlobalOptionsRegistrar.register_options_on_scope方法的典型用法代码示例。如果您正苦于以下问题:Python GlobalOptionsRegistrar.register_options_on_scope方法的具体用法?Python GlobalOptionsRegistrar.register_options_on_scope怎么用?Python GlobalOptionsRegistrar.register_options_on_scope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.option.global_options.GlobalOptionsRegistrar
的用法示例。
在下文中一共展示了GlobalOptionsRegistrar.register_options_on_scope方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _register_options
# 需要导入模块: from pants.option.global_options import GlobalOptionsRegistrar [as 别名]
# 或者: from pants.option.global_options.GlobalOptionsRegistrar import register_options_on_scope [as 别名]
def _register_options(self, subsystems, options):
"""Registers global options."""
# Standalone global options.
GlobalOptionsRegistrar.register_options_on_scope(options)
# Options for subsystems.
for subsystem in subsystems:
subsystem.register_options_on_scope(options)
# TODO(benjy): Should Goals or the entire goal-running mechanism be a Subsystem?
for goal in Goal.all():
# Register task options.
goal.register_options(options)
示例2: register_options
# 需要导入模块: from pants.option.global_options import GlobalOptionsRegistrar [as 别名]
# 或者: from pants.option.global_options.GlobalOptionsRegistrar import register_options_on_scope [as 别名]
def register_options(self, subsystems):
# Standalone global options.
GlobalOptionsRegistrar.register_options_on_scope(self.options)
# Options for subsystems.
for subsystem in subsystems:
subsystem.register_options_on_scope(self.options)
# TODO(benjy): Should Goals be subsystems? Or should the entire goal-running mechanism
# be a subsystem?
for goal in Goal.all():
# Register task options.
goal.register_options(self.options)
示例3: _options
# 需要导入模块: from pants.option.global_options import GlobalOptionsRegistrar [as 别名]
# 或者: from pants.option.global_options.GlobalOptionsRegistrar import register_options_on_scope [as 别名]
def _options(self):
# NB: The PluginResolver runs very early in the pants startup sequence before the standard
# Subsystem facility is wired up. As a result PluginResolver is not itself a Subsystem with
# PythonRepos as a dependency. Instead it does the minimum possible work to hand-roll
# bootstrapping of the Subsystem it needs.
subsystems = Subsystem.closure([PythonRepos])
known_scope_infos = [subsystem.get_scope_info() for subsystem in subsystems]
options = self._options_bootstrapper.get_full_options(known_scope_infos)
# Ignore command line flags since we'd blow up on any we don't understand (most of them).
# If someone wants to bootstrap plugins in a one-off custom way they'll need to use env vars
# or a --pants-config-files pointing to a custom pants.ini snippet.
defaulted_only_options = options.drop_flag_values()
GlobalOptionsRegistrar.register_options_on_scope(defaulted_only_options)
for subsystem in subsystems:
subsystem.register_options_on_scope(defaulted_only_options)
return defaulted_only_options