diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-05-05 14:10:30 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-05-08 11:05:14 -0400 |
commit | 787ed452c2abe3bad81ffaf732b0b2609e3534bb (patch) | |
tree | efe45de24864649b4219e6a45c1ebfb82574fe28 /klippy/extras/thermistor.py | |
parent | 8472c57b594e6f8ff26d7be32b4bdd5072ed439a (diff) | |
download | kutter-787ed452c2abe3bad81ffaf732b0b2609e3534bb.tar.gz kutter-787ed452c2abe3bad81ffaf732b0b2609e3534bb.tar.xz kutter-787ed452c2abe3bad81ffaf732b0b2609e3534bb.zip |
klippy: Rename try_load_module() to load_object()
Rename try_load_module() so that it uses consistent naming for
"printer objects". Change the function to raise an error by default
if the specified module does not exist.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/thermistor.py')
-rw-r--r-- | klippy/extras/thermistor.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/extras/thermistor.py b/klippy/extras/thermistor.py index 7e3aa3aa..ff95afba 100644 --- a/klippy/extras/thermistor.py +++ b/klippy/extras/thermistor.py @@ -116,12 +116,12 @@ Sensors = { def load_config(config): # Register default thermistor types - pheaters = config.get_printer().try_load_module(config, "heaters") + pheaters = config.get_printer().load_object(config, "heaters") for sensor_type, params in Sensors.items(): func = (lambda config, params=params: PrinterThermistor(config, params)) pheaters.add_sensor_factory(sensor_type, func) def load_config_prefix(config): thermistor = CustomThermistor(config) - pheaters = config.get_printer().try_load_module(config, "heaters") + pheaters = config.get_printer().load_object(config, "heaters") pheaters.add_sensor_factory(thermistor.name, thermistor.create) |