aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--klippy/gcode.py3
-rw-r--r--klippy/klippy.py2
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):