Skip to content

Commit

Permalink
implement update check
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Kummer committed Aug 28, 2017
1 parent f37ccd8 commit 44169fc
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions BlenderUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
import platform
from distutils.version import StrictVersion
import json
import webbrowser


app = QtWidgets.QApplication(sys.argv)
appversion = '1.0'
appversion = '1.2'
dir_ = ''
config = configparser.ConfigParser()
btn = {}
Expand Down Expand Up @@ -179,16 +180,17 @@ def __init__(self, parent=None):
self, "Error", "Please check your internet connection")
sys.exit()
# Check for new version on github
Appupdate = urllib.request.urlopen('https://api.github.com/repos/tobkum/BlenderUpdater/releases/latest')
try:
Appupdate = urllib.request.urlopen('https://api.github.com/repos/tobkum/BlenderUpdater/releases/latest')
except Exception:
QtWidgets.QMessageBox.critical(
self, "Error", "Unable to get update information")
UpdateData = json.load(Appupdate)
applatestversion = UpdateData['tag_name']
print(UpdateData['tag_name'])
if StrictVersion(applatestversion) > StrictVersion(appversion):
self.btn_newVersion.clicked.connect(self.getAppUpdate)
self.btn_newVersion.show()
print(applatestversion)




def select_path(self):
global dir_
Expand All @@ -200,6 +202,10 @@ def select_path(self):
else:
pass

def getAppUpdate(self):
webbrowser.open("https://github.com/tobkum/BlenderUpdater/releases/latest")


def about(self):
aboutText = '<html><head/><body><p>Utility to update Blender to the latest buildbot version available at \
<a href="https://builder.blender.org/download/"><span style=" text-decoration: underline; color:#2980b9;">\
Expand Down

0 comments on commit 44169fc

Please sign in to comment.