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
评论列表
文章目录