From: daid303 Date: Mon, 29 Oct 2012 08:15:10 +0000 (+0100) Subject: Fix bug where endcode is not inserted when it starts with a newline. X-Git-Tag: 13.03~230 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=261ba5aa147eaf645c089bd40c50e478d0e18441;p=cura.git Fix bug where endcode is not inserted when it starts with a newline. --- diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 62a32f9c..cb5272bc 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -3,7 +3,7 @@ from __future__ import division #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ -import os, traceback, math, re, zlib, base64, time, sys, platform +import os, traceback, math, re, zlib, base64, time, sys, platform, glob if sys.version_info[0] < 3: import ConfigParser else: @@ -529,5 +529,4 @@ def getAlterationFileContents(filename): clearTempOverride('extruder') else: alterationContents = '' - return unicode(prefix + re.sub("(.)\{([^\}]*)\}", replaceTagMatch, alterationContents).rstrip() + '\n' + postfix).encode('utf-8') - + return unicode(prefix + re.sub("(.)\{([^\}]*)\}", replaceTagMatch, alterationContents).rstrip() + '\n' + postfix).strip().encode('utf-8')