chiark / gitweb /
Fix the default example path, and add support for version file in frozen build.
authordaid303 <daid303@gmail.com>
Mon, 24 Dec 2012 10:55:00 +0000 (11:55 +0100)
committerdaid303 <daid303@gmail.com>
Mon, 24 Dec 2012 10:55:00 +0000 (11:55 +0100)
Cura/util/profile.py
Cura/util/version.py
package.sh

index c15de19a3261833e6457a4b6913ed0c2e538915c..f27227a6bebec53e929784090127d6950a3e795b 100644 (file)
@@ -150,7 +150,7 @@ G92 E0
 }
 preferencesDefaultSettings = {
        'startMode': 'Simple',
-       'lastFile': os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'example', 'UltimakerRobot_support.stl')),
+       'lastFile': os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'resources', 'example', 'UltimakerRobot_support.stl')),
        'machine_width': '205',
        'machine_depth': '205',
        'machine_height': '200',
index ce3c934c37146d002b30d1d4b9a798d48ac342ab..93117f7c2f6dc259974b840d60f7568bac0b2a0c 100644 (file)
@@ -1,10 +1,15 @@
 from __future__ import absolute_import
 
 import os
+import sys
+from Cura.util import resources
 
 def getVersion(getGitVersion = True):
        gitPath = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../../.git"))
-       versionFile = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../version"))
+       if hasattr(sys, 'frozen'):
+               versionFile = os.path.normpath(os.path.join(resources.resourceBasePath, "version"))
+       else:
+               versionFile = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../version"))
        if os.path.exists(gitPath):
                if not getGitVersion:
                        return "dev"
index 748829e37d5940c01672fadd11312fb26b8bc884..12693f17ab79d45e7605ecd7df43c7ba395690a5 100755 (executable)
@@ -106,6 +106,9 @@ if [ "$BUILD_TARGET" = "darwin" ]; then
        #For now, just copy all of Cura so pypy can find it
        cp -a Cura scripts/darwin/dist/Cura.app/Contents/Resources/
 
+    #Add cura version file (should read the version from the bundle with pyobjc, but will figure that out later)
+    echo $BUILD_NAME > scripts/darwin/dist/Cura.app/Contents/Resources/version
+
        cd scripts/darwin
 
        # Install QuickLook plugin