cli.py 文件源码

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

项目:tracboat 作者: nazavode 项目源码 文件源码
def cli(ctx, config_file, verbose):
    """Toolbox for Trac to GitLab migrations."""
    # Read config file and update context_map
    if config_file:
        conf = toml.load(config_file).get('tracboat', {})
        ctx.default_map.update(
            {k: conf for k in ['users', 'migrate', 'export']})
    # Convert verbosity to logging levels
    if verbose == 1:
        level = logging.INFO
    elif verbose >= 2:
        level = logging.DEBUG
    else:  # < 1
        level = logging.ERROR
    logging.basicConfig(level=level, format='%(levelname)-5s %(name)s: %(message)s')
    # Pass configuration to subcommands
    ctx.obj['verbose'] = verbose
    ctx.obj['config-file'] = config_file


################################################################################
# subcommands
################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号