From f5c7fdab7150e0be48bcf8354ea3cb0749944530 Mon Sep 17 00:00:00 2001 From: Juan Pablo Caram Date: Mon, 4 Jul 2016 16:25:59 -0400 Subject: [PATCH] Some cleanup to shell tests. --- FlatCAMApp.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index f069424a..c9e6daaf 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -63,8 +63,8 @@ class App(QtCore.QObject): log.addHandler(handler) ## Version - version = 8.4 - version_date = "2015/10" + version = 8.5 + version_date = "2016/7" ## URL for update checks and statistics version_url = "http://flatcam.org/version" @@ -129,6 +129,7 @@ class App(QtCore.QObject): ### OS-specific ### ################### + # Folder for user settings. if sys.platform == 'win32': from win32com.shell import shell, shellcon App.log.debug("Win32!") @@ -168,8 +169,11 @@ class App(QtCore.QObject): # Application directory. Chdir to it. Otherwise, trying to load # GUI icons will fail as thir path is relative. - # This will fail under cx_freeze ... - self.app_home = os.path.dirname(os.path.realpath(__file__)) + if hasattr(sys, "frozen"): + # For cx_freeze and sililar. + self.app_home = os.path.dirname(sys.executable) + else: + self.app_home = os.path.dirname(os.path.realpath(__file__)) App.log.debug("Application path is " + self.app_home) App.log.debug("Started in " + os.getcwd()) os.chdir(self.app_home)