main.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:restfulpy 作者: Carrene 项目源码 文件源码
def __init__(self, application):
        self.application = application
        self.parser = parser = argparse.ArgumentParser(description='%s command line interface.' % application.name)
        parser.add_argument('-p', '--process-name', metavar="PREFIX", default=application.name,
                            help='A string indicates the logger prefix for this process, it helps to configure '
                                 'separate log files per process.')
        parser.add_argument('-c', '--config-file', metavar="FILE",
                            help='List of configuration files separated by space. Default: ""')
        parser.add_argument('-d', '--config-dir', metavar="DIR",
                            help='List of configuration directories separated by space. Default: ""')
        subparsers = parser.add_subparsers(title="sub commands", prog=application.name, dest="command")

        AdminLauncher.register(subparsers)
        ServeLauncher.register(subparsers)
        MigrateLauncher.register(subparsers)
        WorkerLauncher.register(subparsers)
        DevLauncher.register(subparsers)
        application.register_cli_launchers(subparsers)
        argcomplete.autocomplete(parser)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号