__main__.py 文件源码

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

项目:Pext 作者: Pext 项目源码 文件源码
def check_core_update(self) -> Optional[str]:
        """Check if there is an update of the core and if so, return the name of the new version."""
        with urlopen('https://pext.hackerchick.me/version/stable') as update_url:
            available_version = update_url.readline().decode("utf-8").strip()

        # Normalize own version
        if self.version.find('+') != -1:
            print("Current version is an untagged development version, can only check for stable updates")
            normalized_version = self.version[:self.version.find('+')]
        elif self.version.find('-') != -1:
            normalized_version = self.version[:self.version.find('-', self.version.find('-') + 1)]
        else:
            normalized_version = self.version

        if parse_version(normalized_version.lstrip('v')) < parse_version(available_version.lstrip('v')):
            return available_version

        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号