From: Daid Date: Wed, 17 Apr 2013 15:38:50 +0000 (+0200) Subject: Fix the "cura will not close" bug. Fix running the engine for the Mac version. X-Git-Tag: 13.05~82^2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7f9aff9d64b4d08c7a0f95a87075033e0b8bc2ac;p=cura.git Fix the "cura will not close" bug. Fix running the engine for the Mac version. --- diff --git a/Cura/util/sliceEngine.py b/Cura/util/sliceEngine.py index 6dd73514..6281b57c 100644 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@ -6,6 +6,7 @@ import warnings import threading import traceback import platform +import sys from Cura.util import profile @@ -14,6 +15,8 @@ def getEngineFilename(): if os.path.exists('C:/Software/Cura_SteamEngine/_bin/Release/Cura_SteamEngine.exe'): return 'C:/Software/Cura_SteamEngine/_bin/Release/Cura_SteamEngine.exe' return os.path.abspath(os.path.join(os.path.dirname(__file__), '../..', 'SteamEngine.exe')) + if hasattr(sys, 'frozen'): + return os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../..', 'SteamEngine')) return os.path.abspath(os.path.join(os.path.dirname(__file__), '../..', 'SteamEngine')) def getTempFilename(): @@ -34,8 +37,14 @@ class Slicer(object): def cleanup(self): self.abortSlicer() - os.remove(self._binaryStorageFilename) - os.remove(self._exportFilename) + try: + os.remove(self._binaryStorageFilename) + except: + pass + try: + os.remove(self._exportFilename) + except: + pass def abortSlicer(self): if self._process is not None: diff --git a/package.sh b/package.sh index 93d442d9..ea9ec2f4 100755 --- a/package.sh +++ b/package.sh @@ -17,7 +17,7 @@ BUILD_TARGET=${1:-all} ##Do we need to create the final archive ARCHIVE_FOR_DISTRIBUTION=1 ##Which version name are we appending to the final archive -BUILD_NAME=13.03 +BUILD_NAME=13.04-SteamEngine TARGET_DIR=Cura-${BUILD_NAME}-${BUILD_TARGET} ##Which versions of external programs to use @@ -103,14 +103,9 @@ if [ "$BUILD_TARGET" = "darwin" ]; then exit 1 fi - downloadURL https://bitbucket.org/pypy/pypy/downloads/pypy-${PYPY_VERSION}-osx64.tar.bz2 - $TAR -xjf pypy-${PYPY_VERSION}-osx64.tar.bz2 - mv pypy-${PYPY_VERSION} scripts/darwin/dist/Cura.app/Contents/Resources/pypy - #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 + cp SteamEngine scripts/darwin/dist/Cura.app/Contents/Resources/SteamEngine cd scripts/darwin