MCPcopy Create free account
hub / github.com/chasingboy/Xtools / check_version

Function check_version

utils.py:31–42  ·  view source on GitHub ↗
(current_version)

Source from the content-addressed store, hash-verified

29
30
31def check_version(current_version):
32 try:
33 from urllib.request import urlopen
34 readme = urlopen("https://raw.githubusercontent.com/chasingboy/Xtools/main/README.md",timeout=3).read()
35 version = re.findall(r'Version-V(.+)-green',readme.decode())[0]
36
37 if current_version < version:
38 return '最新版本 @{v}, 请下载更新...'.format(v=version)
39 except:
40 return '版本信息获取失败,请github查看'
41
42 return '已是最新版'
43
44### --- END ---
45

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected