config.py 文件源码

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

项目:bittyband 作者: yam655 项目源码 文件源码
def load_home_config(args=None):
    """ Load the user-specific configuration.

        It can not contain the `project` section. It is based upon the
        application's internal defaults. (Note: It will modified with project
        specific settings before it is used.)
    """
    global config
    global home_dir
    if home_dir is None:
        if args is not None and args.user_config is not None:
            home_dir = Path(args.user_config)
        else:
            home_dir = Path("~/.bittyband").expanduser()
        home_dir.mkdir(parents=True, exist_ok=True)
        home_config = home_dir / "settings.conf"
        if home_config.exists():
            config.read(str(home_config))
            if "project" in config:
                config["project"].clear()
            if "instance" in config:
                config["instance"].clear()
    return config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号