MCPcopy Create free account
hub / github.com/Eve-PySpy/PySpy / chk_github_update

Function chk_github_update

chkversion.py:26–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24
25
26def chk_github_update():
27 last_check = config.OPTIONS_OBJECT.Get("last_update_check", 0)
28 if last_check == 0 or last_check < datetime.date.today():
29 # Get latest version available on GitHub
30 GIT_URL = "https://api.github.com/repos/Eve-PySpy/PySpy/releases/latest"
31 try:
32 # verify=False to avoid certificate errors. This is not critical.
33 latest_ver = requests.get(GIT_URL, verify=False).json()["tag_name"]
34 Logger.info(
35 "You are running " + CURRENT_VER + " and " +
36 latest_ver + " is the latest version available on GitHub."
37 )
38 config.OPTIONS_OBJECT.Set("last_update_check", datetime.date.today())
39 if latest_ver != CURRENT_VER:
40 wx.CallAfter(__main__.app.PySpy.updateAlert, latest_ver, CURRENT_VER)
41 except:
42 Logger.info("Could not check GitHub for potential available updates.")
43
44

Callers

nothing calls this directly

Calls 2

GetMethod · 0.80
SetMethod · 0.80

Tested by

no test coverage detected