Commit c1f315d6 authored by Guillaume Seguin's avatar Guillaume Seguin

Add argument to gcoder.GCode.append to opt out storing

parent c6d74a15
...@@ -144,7 +144,7 @@ class GCode(object): ...@@ -144,7 +144,7 @@ class GCode(object):
def __iter__(self): def __iter__(self):
return self.lines.__iter__() return self.lines.__iter__()
def append(self, command): def append(self, command, store = True):
command = command.strip() command = command.strip()
if not command: if not command:
return return
...@@ -152,9 +152,10 @@ class GCode(object): ...@@ -152,9 +152,10 @@ class GCode(object):
self.lines.append(gline) self.lines.append(gline)
self._preprocess_lines([gline]) self._preprocess_lines([gline])
self._preprocess_extrusion([gline]) self._preprocess_extrusion([gline])
self.append_layer.append(gline) if store:
self.layer_idxs.append(self.append_layer_id) self.append_layer.append(gline)
self.line_idxs.append(len(self.append_layer)) self.layer_idxs.append(self.append_layer_id)
self.line_idxs.append(len(self.append_layer))
return gline return gline
def _preprocess_lines(self, lines = None): def _preprocess_lines(self, lines = None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment