Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework the update process #155

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def processAction(self, msg):
else:
self.data.ui_queue1.put("Alert", "Alert", "No GCode file loaded.")
elif msg["data"]["command"] == "update":
if not self.data.releaseManager.update(msg["data"]["arg"]):
self.data.ui_queue1.put("Alert", "Alert", "Error with updating webcontrol.")
return "Shutdown"
# Errors handled during update so only reboot on success.
if self.data.releaseManager.update(msg["data"]["arg"]):
return "Shutdown"
elif msg["data"]["command"] == "cutTriangularCalibrationPattern":
if not self.data.triangularCalibration.cutTriangularCalibrationPattern():
self.data.ui_queue1.put("Alert", "Alert", "Error with cutting triangular calibration pattern.")
Expand Down Expand Up @@ -1989,7 +1989,7 @@ def checkForLatestPyRelease(self):
except:
print("error parsing tagname")
print(latest)
if latest>self.data.pyInstallCurrentVersion:
if latest>self.data.pyInstallCurrentVersionNumber:
if latestRelease is not None:
print(latestRelease.tag_name)
assets = latestRelease.get_assets()
Expand Down
2 changes: 1 addition & 1 deletion Background/messageProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def start(self):
# check for available update file every hour.
if time.time()-self.data.lastChecked > 60*60:
self.data.lastChecked = time.time()
self.data.releaseManager.checkForLatestPyRelease()
self.data.releaseManager.checkLatestRelease(True)
self.data.helpManager.checkForUpdatedHelp()
# process messages while queue is not empty. Everything else is on hold until queue is cleared.
while ( not self.data.message_queue.empty() ): # if there is new data to be read
Expand Down
5 changes: 3 additions & 2 deletions DataStructures/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from DataStructures.uiQueue import UIQueue
from config.config import Config
import queue

import datetime

class Data:
"""
Expand Down Expand Up @@ -38,7 +38,8 @@ class Data:
Version Updater
'''
lastChecked = -1
pyInstallCurrentVersion = 0.94
pyInstallCurrentVersionNumber = 0.94
pyInstallCurrentVersionDate = datetime.datetime(2020, 5, 21)
pyInstallUpdateAvailable = False
pyInstallUpdateBrowserUrl = ""
pyInstallUpdateVersion = 0
Expand Down
Loading