Fixed #198 - This was a tricky one, because the project planner added an override in unicode, the start code was converted from utf-8 to unicode, and thus the getGlobalProfileString tried to store an unicode string, while it is designed to encode utf-8 encoded strings. Python3 should catch these issues better, but there is no wxPython for python3 yet.
This commit is contained in:
parent
c18fb0df4c
commit
06cc746378
1 changed files with 4 additions and 4 deletions
|
@ -242,7 +242,7 @@ def getGlobalProfileString():
|
||||||
if globalProfileParser.has_section('profile'):
|
if globalProfileParser.has_section('profile'):
|
||||||
for key in globalProfileParser.options('profile'):
|
for key in globalProfileParser.options('profile'):
|
||||||
if key in tempOverride:
|
if key in tempOverride:
|
||||||
p.append(key + "=" + unicode(tempOverride[key]))
|
p.append(key + "=" + tempOverride[key])
|
||||||
tempDone.append(key)
|
tempDone.append(key)
|
||||||
else:
|
else:
|
||||||
p.append(key + "=" + globalProfileParser.get('profile', key))
|
p.append(key + "=" + globalProfileParser.get('profile', key))
|
||||||
|
@ -255,14 +255,14 @@ def getGlobalProfileString():
|
||||||
alt.append(key + "=" + globalProfileParser.get('alterations', key))
|
alt.append(key + "=" + globalProfileParser.get('alterations', key))
|
||||||
for key in tempOverride:
|
for key in tempOverride:
|
||||||
if key not in tempDone:
|
if key not in tempDone:
|
||||||
p.append(key + "=" + unicode(tempOverride[key]))
|
p.append(key + "=" + tempOverride[key])
|
||||||
ret = '\b'.join(p) + '\f' + '\b'.join(alt)
|
ret = '\b'.join(p) + '\f' + '\b'.join(alt)
|
||||||
ret = base64.b64encode(zlib.compress(ret, 9))
|
ret = base64.b64encode(zlib.compress(ret, 9))
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def getProfileSetting(name):
|
def getProfileSetting(name):
|
||||||
if name in tempOverride:
|
if name in tempOverride:
|
||||||
return unicode(tempOverride[name])
|
return unicode(tempOverride[name], "utf-8")
|
||||||
#Check if we have a configuration file loaded, else load the default.
|
#Check if we have a configuration file loaded, else load the default.
|
||||||
if not globals().has_key('globalProfileParser'):
|
if not globals().has_key('globalProfileParser'):
|
||||||
loadGlobalProfile(getDefaultProfilePath())
|
loadGlobalProfile(getDefaultProfilePath())
|
||||||
|
@ -362,7 +362,7 @@ def isPreference(name):
|
||||||
## Temp overrides for multi-extruder slicing and the project planner.
|
## Temp overrides for multi-extruder slicing and the project planner.
|
||||||
tempOverride = {}
|
tempOverride = {}
|
||||||
def setTempOverride(name, value):
|
def setTempOverride(name, value):
|
||||||
tempOverride[name] = value
|
tempOverride[name] = unicode(value).encode("utf-8")
|
||||||
def resetTempOverride():
|
def resetTempOverride():
|
||||||
tempOverride.clear()
|
tempOverride.clear()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue