Commit 1ea9fe19 authored by Guillaume Seguin's avatar Guillaume Seguin

Allow creating a GCode object without any argument

parent 4b04d190
...@@ -174,12 +174,12 @@ class GCode(object): ...@@ -174,12 +174,12 @@ class GCode(object):
self.home_x, self.home_y, self.home_z = home_pos self.home_x, self.home_y, self.home_z = home_pos
home_pos = property(_get_home_pos, _set_home_pos) home_pos = property(_get_home_pos, _set_home_pos)
def __init__(self, data, home_pos = None): def __init__(self, data = None, home_pos = None):
self.home_pos = home_pos
if data:
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.home_pos = home_pos
if self.lines:
self._preprocess_lines() self._preprocess_lines()
self.filament_length = self._preprocess_extrusion() self.filament_length = self._preprocess_extrusion()
self._create_layers() self._create_layers()
......
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