diff options
author | Melody Horn <melody@boringcactus.com> | 2020-12-24 01:37:57 -0700 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2020-12-24 01:37:57 -0700 |
commit | 1cfe4d7ca87b2a6926f29a098a6b8e33393fbaa0 (patch) | |
tree | fdbbbf93c4f2b087cb54f749d134e75a4cdb0af1 | |
parent | c3b486b598ab3b4f69ef9c7b2605a0ac85cb7d2a (diff) | |
download | vidslice-1cfe4d7ca87b2a6926f29a098a6b8e33393fbaa0.tar.gz vidslice-1cfe4d7ca87b2a6926f29a098a6b8e33393fbaa0.zip |
make the API call manually instead of pulling in a whole dependency
-rw-r--r-- | requirements.txt | 3 | ||||
-rw-r--r-- | vidslice.py | 23 |
2 files changed, 13 insertions, 13 deletions
diff --git a/requirements.txt b/requirements.txt index 16a7ca2..5767b25 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ -wxPython==4.0.4 +wxPython cx_Freeze -agithub diff --git a/vidslice.py b/vidslice.py index 1f52dbc..04a7fc0 100644 --- a/vidslice.py +++ b/vidslice.py @@ -1,9 +1,10 @@ +import json import subprocess import sys +import urllib.request import wx import wx.adv -from agithub.GitHub import GitHub from options import OptionsPanel from output import OutputPanel @@ -13,16 +14,16 @@ VERSION = "1.5" def check_update(parent): - client = GitHub() - status, data = client.repos.boringcactus.vidslice.releases.latest.get() - if status == 200: - newest_version = data['tag_name'].lstrip('v') - if VERSION != newest_version: - answer = wx.MessageBox("vidslice update available. download?", "Update", wx.YES_NO, parent) - if answer == wx.YES: - import webbrowser - - webbrowser.open("https://github.com/boringcactus/vidslice/releases/latest") + latest_release_api_url = 'https://api.github.com/repos/boringcactus/vidslice/releases/latest' + with urllib.request.urlopen(latest_release_api_url) as latest_release_response: + latest_release_obj = json.load(latest_release_response) + newest_version = latest_release_obj['tag_name'].lstrip('v') + if VERSION != newest_version: + answer = wx.MessageBox("vidslice update available. download?", "Update", wx.YES_NO, parent) + if answer == wx.YES: + import webbrowser + + webbrowser.open("https://github.com/boringcactus/vidslice/releases/latest") def has_ffmpeg(): |