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
################################################################################
评论列表
文章目录