config_file.py 文件源码

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

项目:DataFS 作者: ClimateImpactLab 项目源码 文件源码
def __init__(self, config_file=None, default_profile='default'):
        self.default_profile = default_profile
        self.config = {
            'default-profile': self.default_profile,
            'requirements': None,
            'profiles': {}}

        if config_file:
            self.config_file = config_file
        else:
            self.config_file = os.path.join(
                click.get_app_dir('datafs'), 'config.yml')

            # Create default directory if it does not exist
            # If using a user-supplied file, they are responsible for creating
            # the directory.
            if not os.path.isdir(os.path.dirname(self.config_file)):
                os.makedirs(os.path.dirname(self.config_file))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号