diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-08-04 15:49:40 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-08-06 14:21:08 -0400 |
commit | 8c8b9b18120ddba92551f8f07e2407f9d190c9db (patch) | |
tree | 5aa73cbad695763cf4baa006f729a0d4ddf3f173 /klippy | |
parent | 0d930bf8718c316ec0f40440d102ffd4fa66b91e (diff) | |
download | kutter-8c8b9b18120ddba92551f8f07e2407f9d190c9db.tar.gz kutter-8c8b9b18120ddba92551f8f07e2407f9d190c9db.tar.xz kutter-8c8b9b18120ddba92551f8f07e2407f9d190c9db.zip |
gcode: Introduce add_early_printer_objects()
Create the initial gcode class via new module level
add_early_printer_objects() function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/gcode.py | 3 | ||||
-rw-r--r-- | klippy/klippy.py | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index 2b9c8cc2..32c0fa4f 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -719,3 +719,6 @@ class GCodeParser: if cmd in self.gcode_help: cmdhelp.append("%-10s: %s" % (cmd, self.gcode_help[cmd])) gcmd.respond_info("\n".join(cmdhelp), log=False) + +def add_early_printer_objects(printer): + printer.add_object('gcode', GCodeParser(printer)) diff --git a/klippy/klippy.py b/klippy/klippy.py index 5fc013fa..678c0980 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -59,7 +59,7 @@ class Printer: self.event_handlers = {} self.objects = collections.OrderedDict() self.objects['webhooks'] = webhooks.WebHooks(self) - self.objects['gcode'] = gcode.GCodeParser(self) + gcode.add_early_printer_objects(self) def get_start_args(self): return self.start_args def get_reactor(self): |