本文整理汇总了Python中pants.goal.run_tracker.RunTracker.register_options方法的典型用法代码示例。如果您正苦于以下问题:Python RunTracker.register_options方法的具体用法?Python RunTracker.register_options怎么用?Python RunTracker.register_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.goal.run_tracker.RunTracker
的用法示例。
在下文中一共展示了RunTracker.register_options方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register_options
# 需要导入模块: from pants.goal.run_tracker import RunTracker [as 别名]
# 或者: from pants.goal.run_tracker.RunTracker import register_options [as 别名]
def register_options(self):
# Add a 'bootstrap' attribute to the register function, so that register_global can
# access the bootstrap option values.
def register_global(*args, **kwargs):
return self.options.register_global(*args, **kwargs)
register_global.bootstrap = self.options.bootstrap_option_values()
register_global_options(register_global)
# This is the first case we have of non-task, non-global options.
# The current implementation special-cases RunTracker, and is temporary.
# In the near future it will be replaced with a 'Subsystem' abstraction.
# But for now this is useful for kicking the tires.
def register_run_tracker(*args, **kwargs):
self.options.register('run-tracker', *args, **kwargs)
RunTracker.register_options(register_run_tracker)
for goal in Goal.all():
goal.register_options(self.options)