本文整理汇总了Python中twitter.pants.commands.Command.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Command.__init__方法的具体用法?Python Command.__init__怎么用?Python Command.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter.pants.commands.Command
的用法示例。
在下文中一共展示了Command.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from twitter.pants.commands import Command [as 别名]
# 或者: from twitter.pants.commands.Command import __init__ [as 别名]
def __init__(self, root_dir, parser, argv):
Command.__init__(self, root_dir, parser, argv)
if len(self.args) is not 1:
self.error("Exactly one BUILD address is required.")
spec = self.args[0]
try:
address = Address.parse(root_dir, spec)
except IOError:
self.error("Problem parsing spec %s: %s" % (spec, traceback.format_exc()))
try:
self.target = Target.get(address)
except (ImportError, SyntaxError, TypeError):
self.error("Problem parsing BUILD target %s: %s" % (address, traceback.format_exc()))
if not self.target:
self.error("Target %s does not exist" % address)
示例2: __init__
# 需要导入模块: from twitter.pants.commands import Command [as 别名]
# 或者: from twitter.pants.commands.Command import __init__ [as 别名]
def __init__(self, root_dir, parser, args):
self.targets = []
Command.__init__(self, root_dir, parser, args)
示例3: __init__
# 需要导入模块: from twitter.pants.commands import Command [as 别名]
# 或者: from twitter.pants.commands.Command import __init__ [as 别名]
def __init__(self, root_dir, parser, args):
self.targets = []
# Note that we can't gate this on the self.options.time flag, because self.options is
# only set up in Command.__init__, and only after it calls setup_parser(), which uses the timer.
self.timer = Timer()
Command.__init__(self, root_dir, parser, args)