file.py 文件源码

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

项目:keyrings.alt 作者: jaraco 项目源码 文件源码
def _check_file(self):
        """
        Check if the file exists and has the expected password reference.
        """
        if not os.path.exists(self.file_path):
            return False
        self._migrate()
        config = configparser.RawConfigParser()
        config.read(self.file_path)
        try:
            config.get(
                escape_for_ini('keyring-setting'),
                escape_for_ini('password reference'),
            )
        except (configparser.NoSectionError, configparser.NoOptionError):
            return False
        try:
            self._check_scheme(config)
        except AttributeError:
            # accept a missing scheme
            return True
        return self._check_version(config)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号