Remove newlines in deserialisation

The artificial line-breaks for the 80-character limit were taken along with the read-by-line of reading the g-code file, apparently. This obviously produced errors in the config parser.

Contributes to issue CURA-34.
This commit is contained in:
Ghostkeeper 2015-12-10 13:54:18 +01:00
parent 5358dfe2d6
commit 6d225948f2

View File

@ -26,10 +26,10 @@ class GCodeReader(MeshReader):
with open(file_name) as f:
for line in f:
if line.startswith(prefix):
serialised += line[len(prefix):] #Remove the prefix from the line, and add it to the rest.
serialised += line[len(prefix):-1] #Remove the prefix and the newline from the line, and add it to the rest.
except IOError as e:
Logger.log("e", "Unable to open file %s for reading: %s", file_name, str(e))
#Unescape the serialised profile.
escape_characters = { #Which special characters (keys) are replaced by what escape character (values).
#Note: The keys are regex strings. Values are not.