config.py 文件源码

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

项目:dj 作者: aleontiev 项目源码 文件源码
def _load(self):
            """Load config file into memory."""
            try:
                with open(self.file, 'r') as file:
                    self._data = yaml.load(file)
            except IOError:
                # no config file
                pass
            except yaml.YAMLError as err:
                raise Exception(
                    'Could not parse corrupt config file: %s\n'
                    'Try running "rm %s"' % (
                        str(err),
                        self.file,
                    )
                )
            # set defaults
            for key, value in Config.defaults.items():
                if key not in self._data:
                    self._data[key] = value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号