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>
This commit is contained in:
Kevin O'Connor 2020-08-04 15:49:40 -04:00
parent 0d930bf871
commit 8c8b9b1812
2 changed files with 4 additions and 1 deletions

View File

@ -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))

View File

@ -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):