本文整理汇总了Python中job.Job.get_func_help方法的典型用法代码示例。如果您正苦于以下问题:Python Job.get_func_help方法的具体用法?Python Job.get_func_help怎么用?Python Job.get_func_help使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类job.Job
的用法示例。
在下文中一共展示了Job.get_func_help方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_ls
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import get_func_help [as 别名]
def do_ls(self, pattern=""):
"""
list all jobs. similar to print_paths in Router._parse_args.
"""
if pattern:
print "The available jobs with substring %s are:" % pattern
else:
print "The available jobs are:"
app_order = self.router.app_order
app_path = self.router.app_path
n = len(self.router.app_order)
j = 0
for i in range(n):
path = app_order[i]
if path.find(pattern) != -1:
j += 1
app, type = app_path[path]
if type == "func":
print " %d. %-12s [%4s] --> %s" % (i, path, type, Job.get_func_help(app))
elif type in ("Job", "MJob", "PJob"):
print " %d. %-12s [%4s] --> %s" % (i, path, type, app.get_line_help())
else:
raise Exception("unknown Object type = %s of %s" % (type, app) )
if pattern:
print "There are %d/%d including '%s'" % (j, n, pattern)
示例2: print_paths
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import get_func_help [as 别名]
def print_paths():
""""""
print "The available Job are:"
for path in self.app_order:
(app, type) = self.app_path[path]
if type == "func":
print " %-12s [%4s] --> %s" % (path, type, Job.get_func_help(app))
elif type in ("Job", "MJob", "PJob"):
print " %-12s [%4s] --> %s" % (path, type, app.get_line_help())
else:
raise Exception("unknown Object type = %s of %s" % (type, app) )
示例3: print_path_help
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import get_func_help [as 别名]
def print_path_help(self, path):
"""print the help of certain path"""
(app, type) = self.app_path[path]
if type == "func":
print " %s [%s] --> %s" % (path, type, Job.get_func_help(app))
for line in _decode(app.__doc__).split("\n"):
print " " + line
print Job.get_func_config(app, prefix=" ")
elif type in ("Job", "MJob", "PJob"):
print " %s [%s] --> %s" % (path, type, app.get_line_help())
for line in _decode(app.__doc__).split("\n"):
print " " + line
print app.get_config_str(prefix=" ")
else:
raise Exception("unknown Object type = %s of %s" % (type, app) )
print ""