Skip to content

Commit

Permalink
Optimized update function
Browse files Browse the repository at this point in the history
  • Loading branch information
MNThomson committed Feb 1, 2021
1 parent eba2214 commit 3594ce6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ On some Windows PC's, Windows Smart Screen will trigger when running an unknown
- [x] Download example csv if not detected (option box)
- [x] Added an `open_data` function to remove duplicate code
- [x] Optimize image size in `/assets`
- [x] Optimized update function
- [ ] Fix hanging terminal after joining class
- [ ] Add MacOS/Linux support (find binary installation location)
- [ ] Add system tray icon
Expand Down
18 changes: 12 additions & 6 deletions Update.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import requests, webbrowser, sys
import requests, webbrowser, json, time, sys

VERSION = "1.0.3"
Update_URL = 'https://github.com/MNThomson/ZoomBuddy/releases/latest'
VERSION = "1.0.4"
Update_URL = 'https://api.github.com/repos/mnthomson/zoombuddy/releases/latest'

def update():
r = requests.get(Update_URL)
CURRENT_VERSION = r.url.split("v")[1]
response = requests.get(Update_URL).text
data = json.loads(response)
CURRENT_VERSION = data['tag_name'].split("v")[1]

if (int(VERSION.replace('.','')) < int(CURRENT_VERSION.replace('.',''))):
print("Downloaded Version: " + VERSION)
Expand All @@ -20,4 +21,9 @@ def update():
else:
pass
else:
pass
pass

if __name__ == "__main__":
start_time = time.time()
update()
print("--- %s seconds ---" % (time.time() - start_time))

0 comments on commit 3594ce6

Please sign in to comment.