chiark / gitweb /
Fix encoding bug when using locals with none-ascii chars in it.
authordaid303 <daid303@gmail.com>
Mon, 10 Dec 2012 09:09:55 +0000 (10:09 +0100)
committerdaid303 <daid303@gmail.com>
Mon, 10 Dec 2012 09:09:55 +0000 (10:09 +0100)
Cura/util/profile.py
Cura/util/sliceRun.py
scripts/linux/cura.sh

index d2f4d3d53f0e92076e7d520ba898d09b8438fd87..0b63e90bb5fd2b30501884aab4d2c5f35274abec 100644 (file)
@@ -429,11 +429,11 @@ def replaceTagMatch(m):
        pre = m.group(1)
        tag = m.group(2)
        if tag == 'time':
-               return pre + time.strftime('%H:%M:%S')
+               return pre + time.strftime('%H:%M:%S').encode('utf-8', 'replace')
        if tag == 'date':
-               return pre + time.strftime('%d %b %Y')
+               return pre + time.strftime('%d %b %Y').encode('utf-8', 'replace')
        if tag == 'day':
-               return pre + time.strftime('%a')
+               return pre + time.strftime('%a').encode('utf-8', 'replace')
        if tag == 'print_time':
                return pre + '#P_TIME#'
        if tag == 'filament_amount':
index e749e48bf69fd81789a173458dc1f452b6ae5001..7ec7fa1c7e6d575c79905011ffd5132749be3f0f 100644 (file)
@@ -168,11 +168,11 @@ def getSliceCommand(filename):
                        pypyExe = sys.executable
                
                #In case we have a frozen exe, then argv[0] points to the executable, but we want to give pypy a real script file.
-               if hasattr(sys, 'frozen'):
-                       mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../..", "cura_sf.zip"))
-               else:
-                       mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", os.path.split(sys.argv[0])[1]))
-               cmd = [pypyExe, mainScriptFile, '-p', profile.getGlobalProfileString(), '-s']
+               #if hasattr(sys, 'frozen'):
+               #       mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../..", "cura_sf.zip"))
+               #else:
+               #       mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", os.path.split(sys.argv[0])[1]))
+               cmd = [pypyExe, '-m', 'Cura.cura', '-p', profile.getGlobalProfileString(), '-s']
                if platform.system() == "Windows":
                        try:
                                cmd.append(str(filename))
index 53c16d0df5e49c7078c5a7423f782cc7478c51f5..05f00075b1354b997ded7776cdce91781add00fd 100755 (executable)
@@ -20,5 +20,5 @@ if [ $? != 0 ]; then
 fi
 
 SCRIPT_DIR=`dirname $0`
-python ${SCRIPT_DIR}/Cura/cura.py $@
-
+cd $SCRIPT_DIR
+python -m Cura.cura $@