From 6d225948f2aa773f14bddaae2cf6773c8b39d0cc Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 10 Dec 2015 13:54:18 +0100 Subject: [PATCH] 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. --- plugins/GCodeReader/GCodeReader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/GCodeReader/GCodeReader.py b/plugins/GCodeReader/GCodeReader.py index 2d8aef03c9..3c528c020b 100644 --- a/plugins/GCodeReader/GCodeReader.py +++ b/plugins/GCodeReader/GCodeReader.py @@ -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.