Commit 0d6d7175 authored by Guillaume Seguin's avatar Guillaume Seguin

Only do the processing if there's data to process in GCoder

parent e425728a
...@@ -134,10 +134,11 @@ class GCode(object): ...@@ -134,10 +134,11 @@ class GCode(object):
self.lines = [Line(l2) for l2 in self.lines = [Line(l2) for l2 in
(l.strip() for l in data) (l.strip() for l in data)
if l2] if l2]
self._preprocess_lines() if self.lines:
self.filament_length = self._preprocess_extrusion() self._preprocess_lines()
self._create_layers() self.filament_length = self._preprocess_extrusion()
self._preprocess_layers() self._create_layers()
self._preprocess_layers()
def __len__(self): def __len__(self):
return len(self.line_idxs) return len(self.line_idxs)
......
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