mirror of https://github.com/Desuuuu/klipper.git
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:
parent
0d930bf871
commit
8c8b9b1812
|
@ -719,3 +719,6 @@ class GCodeParser:
|
||||||
if cmd in self.gcode_help:
|
if cmd in self.gcode_help:
|
||||||
cmdhelp.append("%-10s: %s" % (cmd, self.gcode_help[cmd]))
|
cmdhelp.append("%-10s: %s" % (cmd, self.gcode_help[cmd]))
|
||||||
gcmd.respond_info("\n".join(cmdhelp), log=False)
|
gcmd.respond_info("\n".join(cmdhelp), log=False)
|
||||||
|
|
||||||
|
def add_early_printer_objects(printer):
|
||||||
|
printer.add_object('gcode', GCodeParser(printer))
|
||||||
|
|
|
@ -59,7 +59,7 @@ class Printer:
|
||||||
self.event_handlers = {}
|
self.event_handlers = {}
|
||||||
self.objects = collections.OrderedDict()
|
self.objects = collections.OrderedDict()
|
||||||
self.objects['webhooks'] = webhooks.WebHooks(self)
|
self.objects['webhooks'] = webhooks.WebHooks(self)
|
||||||
self.objects['gcode'] = gcode.GCodeParser(self)
|
gcode.add_early_printer_objects(self)
|
||||||
def get_start_args(self):
|
def get_start_args(self):
|
||||||
return self.start_args
|
return self.start_args
|
||||||
def get_reactor(self):
|
def get_reactor(self):
|
||||||
|
|
Loading…
Reference in New Issue