chiark / gitweb /
Fix the problem with the py2app version of the print window.
authorDaid <Daid303@gmail.com>
Thu, 20 Dec 2012 12:03:22 +0000 (13:03 +0100)
committerDaid <Daid303@gmail.com>
Thu, 20 Dec 2012 12:03:22 +0000 (13:03 +0100)
Cura/gui/printWindow.py

index 20ffebc4aeb5c8b3d73ca722da47968851e95c9e..3b004e1bb8a6b586a87da85ff6b6abaf8d99c2b4 100644 (file)
@@ -7,6 +7,7 @@ import subprocess
 import sys
 import time
 import platform
+import os
 import power
 
 import wx
@@ -47,7 +48,12 @@ class printProcessMonitor():
 
        def loadFile(self, filename):
                if self.handle == None:
-                       cmdList = [sys.executable, sys.argv[0], '-r', filename]
+                       if platform.system() == "Darwin" and hasattr(sys, 'frozen'):
+                               cmdList = [os.path.join(os.path.dirname(sys.executable), 'Cura')] 
+                       else:
+                               cmdList = [sys.executable, sys.argv[0]]
+                       cmdList.append('-r')
+                       cmdList.append(filename)
                        if platform.system() == "Darwin":
                                if platform.machine() == 'i386':
                                        cmdList.insert(0, 'arch')