本文整理汇总了Python中twitter.pants.goal.Phase.goals方法的典型用法代码示例。如果您正苦于以下问题:Python Phase.goals方法的具体用法?Python Phase.goals怎么用?Python Phase.goals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter.pants.goal.Phase
的用法示例。
在下文中一共展示了Phase.goals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from twitter.pants.goal import Phase [as 别名]
# 或者: from twitter.pants.goal.Phase import goals [as 别名]
def execute(self, targets):
goal = self.context.options.help_goal
if goal is None:
return self.list_goals('You must supply a goal name to provide help for.')
phase = Phase(goal)
if not phase.goals():
return self.list_goals('Goal %s is unknown.' % goal)
parser = Help.parser()
parser.set_usage('%s goal %s ([target]...)' % (sys.argv[0], goal))
parser.epilog = phase.description
Phase.setup_parser(parser, [], [phase])
parser.parse_args(['--help'])
示例2: execute
# 需要导入模块: from twitter.pants.goal import Phase [as 别名]
# 或者: from twitter.pants.goal.Phase import goals [as 别名]
def execute(self, targets):
goal = self.context.options.help_goal
if goal is None:
return self.list_goals("You must supply a goal name to provide help for.")
phase = Phase(goal)
if not phase.goals():
return self.list_goals("Goal %s is unknown." % goal)
parser = OptionParser()
parser.set_usage("%s goal %s ([target]...)" % (sys.argv[0], goal))
parser.epilog = phase.description
Goal.add_global_options(parser)
Phase.setup_parser(parser, [], [phase])
parser.parse_args(["--help"])