chiark / gitweb /
Added setup.py script for cx_Freeze, which I hope will help building a proper MacOS...
authordaid <daid303@gmail.com>
Thu, 31 May 2012 16:01:57 +0000 (18:01 +0200)
committerdaid <daid303@gmail.com>
Thu, 31 May 2012 16:01:57 +0000 (18:01 +0200)
Cura/setup.py [new file with mode: 0644]
Cura/util/gcodeInterpreter.py

diff --git a/Cura/setup.py b/Cura/setup.py
new file mode 100644 (file)
index 0000000..104c1de
--- /dev/null
@@ -0,0 +1,23 @@
+import sys
+from cx_Freeze import setup, Executable
+
+sys.path.append('./cura_sf/')
+
+# Dependencies are automatically detected, but it might need fine tuning.
+build_exe_options = {"packages": [
+       'encodings.utf_8',
+       "OpenGL", "OpenGL.arrays", "OpenGL.platform",
+], "excludes": [], "optimize": 0}
+
+# GUI applications require a different base on Windows (the default is for a
+# console application).
+base = None
+if sys.platform == "win32":
+    base = "Win32GUI"
+
+setup(  name = "Cura",
+        version = "RC5",
+        description = "Cura",
+        options = {"build_exe": build_exe_options},
+        executables = [Executable("cura.py", base=base)])
+
index 9abcacc1e914126a78a9f76d04a56115ea32d7df..1678640bed7005aed739f8f7e3f496d57ad12098 100644 (file)
@@ -22,10 +22,11 @@ class gcode(object):
                self.progressCallback = None
        
        def load(self, filename):
-               self._fileSize = os.stat(filename).st_size
-               gcodeFile = open(filename, 'r')
-               self._load(gcodeFile)
-               gcodeFile.close()
+               if os.path.isfile(filename):
+                       self._fileSize = os.stat(filename).st_size
+                       gcodeFile = open(filename, 'r')
+                       self._load(gcodeFile)
+                       gcodeFile.close()
        
        def loadList(self, l):
                self._load(l)