当前位置: 首页>>代码示例>>Python>>正文


Python Job.get_func_help方法代码示例

本文整理汇总了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)
开发者ID:jumpoutofworld,项目名称:pt-shell,代码行数:28,代码来源:router.py

示例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) )
开发者ID:jumpoutofworld,项目名称:pt-shell,代码行数:13,代码来源:router.py

示例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 ""        
开发者ID:jumpoutofworld,项目名称:pt-shell,代码行数:18,代码来源:router.py


注:本文中的job.Job.get_func_help方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。