chiark / gitweb /
Fix bug where endcode is not inserted when it starts with a newline.
authordaid303 <daid303@gmail.com>
Mon, 29 Oct 2012 08:15:10 +0000 (09:15 +0100)
committerdaid303 <daid303@gmail.com>
Mon, 29 Oct 2012 08:15:10 +0000 (09:15 +0100)
Cura/util/profile.py

index 62a32f9cc1f4f2ea56b959b5d3251c71622ca6a6..cb5272bc33749d60769489132233e74d0dda27ae 100644 (file)
@@ -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.\r
 import __init__\r
 \r
-import os, traceback, math, re, zlib, base64, time, sys, platform \r
+import os, traceback, math, re, zlib, base64, time, sys, platform, glob\r
 if sys.version_info[0] < 3:\r
        import ConfigParser\r
 else:\r
@@ -529,5 +529,4 @@ def getAlterationFileContents(filename):
                        clearTempOverride('extruder')\r
                else:\r
                        alterationContents = ''\r
-       return unicode(prefix + re.sub("(.)\{([^\}]*)\}", replaceTagMatch, alterationContents).rstrip() + '\n' + postfix).encode('utf-8')\r
-\r
+       return unicode(prefix + re.sub("(.)\{([^\}]*)\}", replaceTagMatch, alterationContents).rstrip() + '\n' + postfix).strip().encode('utf-8')\r