From 261ba5aa147eaf645c089bd40c50e478d0e18441 Mon Sep 17 00:00:00 2001 From: daid303 Date: Mon, 29 Oct 2012 09:15:10 +0100 Subject: [PATCH] Fix bug where endcode is not inserted when it starts with a newline. --- Cura/util/profile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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') -- 2.30.2