mirror of
git://soft.sys114.com/klipper
synced 2026-02-11 01:08:07 +09:00
klippy: Add access methods and avoid peeking into the printer classes
Add get_reactor(), lookup_object(), lookup_module_objects(), and set_rollover_info() to the main Printer class so that callers do not need to peek into the class' members. Similarly, add get_printer() and get_name() methods to the ConfigWrapper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -234,7 +234,7 @@ def add_printer_objects(printer, config):
|
||||
printer.add_object('pins', PrinterPins())
|
||||
|
||||
def get_printer_pins(printer):
|
||||
return printer.objects['pins']
|
||||
return printer.lookup_object('pins')
|
||||
|
||||
def setup_pin(printer, pin_type, pin_desc):
|
||||
return get_printer_pins(printer).setup_pin(pin_type, pin_desc)
|
||||
|
||||
Reference in New Issue
Block a user