Fix encoding bug when using locals with none-ascii chars in it.
This commit is contained in:
parent
7376c44b85
commit
98ef38eb46
3 changed files with 10 additions and 10 deletions
|
|
@ -429,11 +429,11 @@ def replaceTagMatch(m):
|
||||||
pre = m.group(1)
|
pre = m.group(1)
|
||||||
tag = m.group(2)
|
tag = m.group(2)
|
||||||
if tag == 'time':
|
if tag == 'time':
|
||||||
return pre + time.strftime('%H:%M:%S')
|
return pre + time.strftime('%H:%M:%S').encode('utf-8', 'replace')
|
||||||
if tag == 'date':
|
if tag == 'date':
|
||||||
return pre + time.strftime('%d %b %Y')
|
return pre + time.strftime('%d %b %Y').encode('utf-8', 'replace')
|
||||||
if tag == 'day':
|
if tag == 'day':
|
||||||
return pre + time.strftime('%a')
|
return pre + time.strftime('%a').encode('utf-8', 'replace')
|
||||||
if tag == 'print_time':
|
if tag == 'print_time':
|
||||||
return pre + '#P_TIME#'
|
return pre + '#P_TIME#'
|
||||||
if tag == 'filament_amount':
|
if tag == 'filament_amount':
|
||||||
|
|
|
||||||
|
|
@ -168,11 +168,11 @@ def getSliceCommand(filename):
|
||||||
pypyExe = sys.executable
|
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.
|
#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'):
|
#if hasattr(sys, 'frozen'):
|
||||||
mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../..", "cura_sf.zip"))
|
# mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../..", "cura_sf.zip"))
|
||||||
else:
|
#else:
|
||||||
mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", os.path.split(sys.argv[0])[1]))
|
# 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']
|
cmd = [pypyExe, '-m', 'Cura.cura', '-p', profile.getGlobalProfileString(), '-s']
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
try:
|
try:
|
||||||
cmd.append(str(filename))
|
cmd.append(str(filename))
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,5 @@ if [ $? != 0 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SCRIPT_DIR=`dirname $0`
|
SCRIPT_DIR=`dirname $0`
|
||||||
python ${SCRIPT_DIR}/Cura/cura.py $@
|
cd $SCRIPT_DIR
|
||||||
|
python -m Cura.cura $@
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue