mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
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:
parent
5358dfe2d6
commit
6d225948f2
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user