def update_check(parent):
"""Check for updates using the GitHub API
Args:
parent (wx.Window): The parent window (for the message dialog)
Returns:
None
"""
r = requests.get('https://api.github.com/repos/10se1ucgo/pyjam/releases/latest')
if not r.ok:
return
new = r.json()['tag_name']
try:
if StrictVersion(__version__) < StrictVersion(new.lstrip('v')):
info = wx.MessageDialog(parent, message="pyjam {v} is now available!\nGo to download page?".format(v=new),
caption="pyjam Update", style=wx.OK | wx.CANCEL | wx.ICON_INFORMATION)
if info.ShowModal() == wx.ID_OK:
webbrowser.open_new_tab(r.json()['html_url'])
info.Destroy()
except ValueError:
pass
评论列表
文章目录