本文整理汇总了Python中tambo.Transport.subhelp方法的典型用法代码示例。如果您正苦于以下问题:Python Transport.subhelp方法的具体用法?Python Transport.subhelp怎么用?Python Transport.subhelp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tambo.Transport
的用法示例。
在下文中一共展示了Transport.subhelp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from tambo import Transport [as 别名]
# 或者: from tambo.Transport import subhelp [as 别名]
def main(self, argv):
parser = Transport(argv, mapper=self.mapper,
options=[], check_help=False,
check_version=False)
parser.parse_args()
parser.catch_help = self.help(parser.subhelp())
parser.catch_version = ceph_installer.__version__
parser.mapper = self.mapper
if len(argv) <= 1:
return parser.print_help()
parser.dispatch()
parser.catches_help()
parser.catches_version()
示例2: parse_args
# 需要导入模块: from tambo import Transport [as 别名]
# 或者: from tambo.Transport import subhelp [as 别名]
def parse_args(self, argv):
"""
Main method for parsing arguments, it uses whatever `argv` is although
it should always be a list. Once it goes through the ``Transport`` class
it tries to generate the help from the mapped classes and the current
docstring for this module.
If nothing matches it will return the help.
"""
self.get_extend_commands()
transport = Transport(argv, self.mapper)
transport.catch_help = "%s \n%s" % (__doc__, transport.subhelp())
transport.catch_version = "dozo version {0}".format(__version__)
if len(self.argv) <= 1:
transport.print_help()
transport.dispatch()