From b418d15daf3efb1eb855450296c50efe1346571d Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 6 Jan 2019 22:04:01 +0200 Subject: [PATCH] - reactivated the version check in case the release is not BETA; FlatCAMApp.App has now a beta object that when set True the application will show in the Title and help-> About that is Beta (and it disable version checking) --- FlatCAMApp.py | 42 +++++++++++++++++++++++++++++++----------- FlatCAMGUI.py | 4 ++-- FlatCAMPool.py | 1 + README.md | 2 ++ requirements.txt | 1 + setup_ubuntu.sh | 1 + 6 files changed, 38 insertions(+), 13 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 57db2e5f..bce89b83 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -87,8 +87,9 @@ class App(QtCore.QObject): log.addHandler(handler) # Version - version = '8.6 Beta1' + version = 8.6 version_date = "2019/01/06" + beta = True # URL for update checks and statistics version_url = "http://flatcam.org/version" @@ -260,7 +261,7 @@ class App(QtCore.QObject): QtCore.QObject.__init__(self) - self.ui = FlatCAMGUI(self.version, self) + self.ui = FlatCAMGUI(self.version, self.beta, self) # self.connect(self.ui, # QtCore.SIGNAL("geomUpdate(int, int, int, int, int)"), # self.save_geometry) PyQt4 @@ -1136,6 +1137,24 @@ class App(QtCore.QObject): print("ERROR: ", ext) sys.exit(2) + ########################### + #### Check for updates #### + ########################### + + # Separate thread (Not worker) + if self.beta is False or self.beta is None: + App.log.info("Checking for updates in backgroud (this is version %s)." % str(self.version)) + + self.thr2 = QtCore.QThread() + self.worker_task.emit({'fcn': self.version_check, + 'params': []}) + self.thr2.start() + + + #################################### + #### Variables for global usage #### + #################################### + # coordinates for relative position display self.rel_point1 = (0, 0) self.rel_point2 = (0, 0) @@ -1996,6 +2015,7 @@ class App(QtCore.QObject): version = self.version version_date = self.version_date + beta = self.beta class AboutDialog(QtWidgets.QDialog): def __init__(self, parent=None): @@ -2017,7 +2037,7 @@ class App(QtCore.QObject): title = QtWidgets.QLabel( "FlatCAM
" - "Version %s (%s) - %s
" + "Version %s %s (%s) - %s
" "
" "2D Computer-Aided Printed Circuit Board
" "Manufacturing.
" @@ -2035,7 +2055,7 @@ class App(QtCore.QObject): "here.
" "DOWNLOAD area " "here.
" - "" % (version, version_date, platform.architecture()[0]) + "" % (version, ('BETA' if beta else ''), version_date, platform.architecture()[0]) ) title.setOpenExternalLinks(True) @@ -5664,20 +5684,20 @@ class App(QtCore.QObject): """ self.log.debug("version_check()") - full_url = App.version_url + \ - "?s=" + str(self.defaults['serial']) + \ - "&v=" + str(self.version) + \ - "&os=" + str(self.os) + \ - "&" + urllib.parse.urlencode(self.defaults["global_stats"]) - App.log.debug("Checking for updates @ %s" % full_url) + full_url = App.version_url + \ + "?s=" + str(self.defaults['global_serial']) + \ + "&v=" + str(self.version) + \ + "&os=" + str(self.os) + \ + "&" + urllib.parse.urlencode(self.defaults["global_stats"]) + App.log.debug("Checking for updates @ %s" % full_url) ### Get the data try: f = urllib.request.urlopen(full_url) except: # App.log.warning("Failed checking for latest version. Could not connect.") self.log.warning("Failed checking for latest version. Could not connect.") - self.inform.emit("[warning] Failed checking for latest version. Could not connect.") + self.inform.emit("[warning_notcl] Failed checking for latest version. Could not connect.") return try: diff --git a/FlatCAMGUI.py b/FlatCAMGUI.py index c014bbb3..0613028a 100644 --- a/FlatCAMGUI.py +++ b/FlatCAMGUI.py @@ -16,7 +16,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow): geom_update = QtCore.pyqtSignal(int, int, int, int, int, name='geomUpdate') final_save = QtCore.pyqtSignal(name='saveBeforeExit') - def __init__(self, version, app): + def __init__(self, version, beta, app): super(FlatCAMGUI, self).__init__() self.app = app @@ -717,7 +717,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.setWindowIcon(self.app_icon) self.setGeometry(100, 100, 1024, 650) - self.setWindowTitle('FlatCAM %s - %s' % (version, platform.architecture()[0])) + self.setWindowTitle('FlatCAM %s %s - %s' % (version, ('BETA' if beta else ''), platform.architecture()[0])) self.show() self.filename = "" diff --git a/FlatCAMPool.py b/FlatCAMPool.py index 3f75b5d0..3c828596 100644 --- a/FlatCAMPool.py +++ b/FlatCAMPool.py @@ -15,6 +15,7 @@ def apply_async(pool, fun, args): def func1(): print("func") + class WorkerPool(QtCore.QObject): def __init__(self): diff --git a/README.md b/README.md index f93dabd2..507b41fb 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ CAD program, and create G-Code for Isolation routing. - fixed cncjob TclCommand - it used the default values for parameters - fixed the layout in ToolTransform - fixed the initial text in the ToolShell +- reactivated the version check in case the release is not BETA; FlatCAMApp.App has now a beta object that when set True the application will show in the Title and help-> About that is Beta (and it disable version checking) + 3.01.2019 diff --git a/requirements.txt b/requirements.txt index f199308b..d0824f83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ # Usage: pip install -r requirements.txt numpy>=1.8 simplejson +dill rtree pyopengl pyopengl-accelerate diff --git a/setup_ubuntu.sh b/setup_ubuntu.sh index c18192ae..636c7a23 100644 --- a/setup_ubuntu.sh +++ b/setup_ubuntu.sh @@ -16,6 +16,7 @@ apt-get install python3-gdal apt-get install python3-lxml apt-get install python3-ezdxf easy_install3 -U distribute +pip3 install --upgrade dill pip3 install --upgrade Shapely pip3 install --upgrade vispy pip3 install --upgrade rtree