cli.py 文件源码

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

项目:inxs 作者: funkyfuture 项目源码 文件源码
def main(args: Sequence[str] = None) -> None:
    nfo('Starting')
    try:
        if args is None:
            args = sys.argv[1:]
        args = parse_args(args)
        setup_logging(args.verbose)
        dbg(f'Invoked with args: {args}')
        transformation = get_transformation(args.transformation)
        document = parse_file(args)
        copy_file(args.target, args.target + '.orig')
        dbg("Saved document backup with suffix '.orig'")
        dbg('Applying transformation.')
        document._setroot(transformation(document.getroot()))
        write_file(document, args)
    except Exception:
        print_exc()
        raise SystemExit(2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号