def check_for_updates():
try:
print(colors.green+"checking for updates..."+colors.end)
r = requests.get("https://api.github.com/repos/4shadoww/hakkuframework/releases/latest")
if(r.ok):
items = json.loads(r.text or r.content)
rver = items['tag_name']
if "beta" in rver and "alpha" in info.version:
print(colors.green+"update found"+colors.end)
return True
elif "beta" not in rver and "alpha" not in rver:
if "beta" in info.version or "alpha" in info.version:
print(colors.green+"update found"+colors.end)
return True
elif version.parse(rver) > version.parse(info.version):
print(colors.green+"update found"+colors.end)
return True
else:
print(colors.yellow+"updates not found"+colors.end)
return False
else:
print("error")
except Exception as error:
print(colors.red+"error: "+str(error)+colors.end)
评论列表
文章目录