config.py 文件源码

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

项目:CodeReader 作者: jasonrbr 项目源码 文件源码
def init(fn=None, config={}):
        '''
        Will initialize the Config object with a given config, if
        given one. Otherwise it will default to just the default
        configuration file.
        Will try to load the defaultly named config file if it exists.
        Otherwise, it will merely have the default configurations.
        '''

        # load the file from memory or default

        Config.is_initialized = True

        if fn:
            Config.config_fn = os.path.join(sublime.installed_packages_path(),
                                            Config.package_dir, fn)
            # Config.config_fn = os.path.abspath(Config.config_fn)

        Config._load_config()

        # load param config file into our config
        for k in config:
            Config.config[k] = config[k]
        Config._save_config()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号