mirror of https://github.com/Desuuuu/klipper.git
webhooks: 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
8c8b9b1812
commit
4346d37c06
|
@ -58,8 +58,9 @@ class Printer:
|
|||
self.run_result = None
|
||||
self.event_handlers = {}
|
||||
self.objects = collections.OrderedDict()
|
||||
self.objects['webhooks'] = webhooks.WebHooks(self)
|
||||
gcode.add_early_printer_objects(self)
|
||||
# Init printer components that must be setup prior to config
|
||||
for m in [webhooks, gcode]:
|
||||
m.add_early_printer_objects(self)
|
||||
def get_start_args(self):
|
||||
return self.start_args
|
||||
def get_reactor(self):
|
||||
|
|
|
@ -268,3 +268,6 @@ class WebHooks:
|
|||
logging.info(msg)
|
||||
raise WebRequestError(msg)
|
||||
return cb
|
||||
|
||||
def add_early_printer_objects(printer):
|
||||
printer.add_object('webhooks', WebHooks(printer))
|
||||
|
|
Loading…
Reference in New Issue