From c89db2480df57204d805f52c9c488e251bafe631 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 4 Sep 2021 13:25:11 -0400 Subject: [PATCH] configfile: Setup get_status() results after check_unused_options() Signed-off-by: Kevin O'Connor --- klippy/configfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/klippy/configfile.py b/klippy/configfile.py index c24cfe16..7b4523ca 100644 --- a/klippy/configfile.py +++ b/klippy/configfile.py @@ -260,7 +260,6 @@ class PrinterConfig: autosave_data = self._strip_duplicates(autosave_data, regular_config) self.autosave = self._build_config_wrapper(autosave_data, filename) cfg = self._build_config_wrapper(regular_data + autosave_data, filename) - self._build_status(cfg) return cfg def check_unused_options(self, config): fileconfig = config.fileconfig @@ -282,10 +281,8 @@ class PrinterConfig: if (section, option) not in access_tracking: raise error("Option '%s' is not valid in section '%s'" % (option, section)) - # Setup self.status_settings - self.status_settings = {} - for (section, option), value in config.access_tracking.items(): - self.status_settings.setdefault(section, {})[option] = value + # Setup get_status() + self._build_status(config) def log_config(self, config): lines = ["===== Config file =====", self._build_config_string(config), @@ -298,6 +295,9 @@ class PrinterConfig: self.status_raw_config[section.get_name()] = section_status = {} for option in section.get_prefix_options(''): section_status[option] = section.get(option, note_valid=False) + self.status_settings = {} + for (section, option), value in config.access_tracking.items(): + self.status_settings.setdefault(section, {})[option] = value def get_status(self, eventtime): return {'config': self.status_raw_config, 'settings': self.status_settings,