jonah.py 文件源码

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

项目:jonah 作者: elgatosf 项目源码 文件源码
def help(self, argv=('jonah',)):
        """Output the help screen"""
        output = "Jonah {} -- ".format(version.__version__)

        output += "USAGE:\n"
        output += "  {} <COMMAND>, where <COMMMAND> is one of the following:\n".format(argv[0])

        commands = {"General": ['init', 'build', 'clean_build', 'cleanup', 'version'],
                    "Development": ['develop', 'reload', 'shell', 'stop', 'test', 'compilemessages'],
                    "Deployment": ['stage', 'deploy', 'tag', 'direct_deploy']}

        for group_name in commands.keys():
            output += "\n  {}:\n".format(group_name)
            for command_name in commands[group_name]:
                command_help = textwrap.wrap(getattr(self, command_name).__doc__, 56)
                output += "  - {}\t{}\n".format(command_name.ljust(12), command_help[0])
                if len(command_help) > 1:
                    for additional_line in command_help[1:]:
                        output += (" " * 20) + "\t" + additional_line + "\n"

        return output

    # Helper Methods ###################################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号