helpformat.py 文件源码

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

项目:Nurevam 作者: Maverun 项目源码 文件源码
def _add_subcommands_to_page(self, max_width, commands):
        for name, command in commands:
            if name in command.aliases:
                # skip aliases
                continue

            entry = '  {0:<{width}} {1}'.format(name, command.short_doc, width=max_width)
            shortened = self.shorten(entry)
            self._paginator.add_line(shortened)
            if isinstance(command,Group):
                    max_count = len(command.commands)
                    uni = "?"
                    for index,command in enumerate(command.commands,start = 1):
                        if index == max_count: uni = "?"
                        entry = '   {uni}{0:<{width}} {1}'.format(command.name, command.short_doc, width=max_width,uni=uni)
                        shortened = self.shorten(entry)
                        self._paginator.add_line(shortened)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号