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.run_result = None
|
||||||
self.event_handlers = {}
|
self.event_handlers = {}
|
||||||
self.objects = collections.OrderedDict()
|
self.objects = collections.OrderedDict()
|
||||||
self.objects['webhooks'] = webhooks.WebHooks(self)
|
# Init printer components that must be setup prior to config
|
||||||
gcode.add_early_printer_objects(self)
|
for m in [webhooks, gcode]:
|
||||||
|
m.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):
|
||||||
|
|
|
@ -268,3 +268,6 @@ class WebHooks:
|
||||||
logging.info(msg)
|
logging.info(msg)
|
||||||
raise WebRequestError(msg)
|
raise WebRequestError(msg)
|
||||||
return cb
|
return cb
|
||||||
|
|
||||||
|
def add_early_printer_objects(printer):
|
||||||
|
printer.add_object('webhooks', WebHooks(printer))
|
||||||
|
|
Loading…
Reference in New Issue