decorators.py 文件源码

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

项目:two1-python 作者: 21dotco 项目源码 文件源码
def get_full_name(ctx):
    """
    Return the fully qualified name of the command.

    >>> main_ctx = click.Context(click.Command('main'))
    >>> market_ctx = click.Context(click.Command('market'), parent=main_ctx)
    >>> join_ctx = click.Context(click.Command('join'), parent=market_ctx)
    >>> get_full_name(join_ctx)
    '21_market_join'
    """
    if ctx.parent is None:  # This is `two1.cli.main`
        return '21'
    else:
        return get_full_name(ctx.parent) + '_' + ctx.command.name
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号