aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/configfile.py
diff options
context:
space:
mode:
authorEric Callahan <Arksine@users.noreply.github.com>2020-09-28 00:05:55 -0400
committerGitHub <noreply@github.com>2020-09-28 00:05:55 -0400
commita8e3afd64aa5db4ea2b846c13be7faf501b20f51 (patch)
treee03d7b676de53b8f79a979270cc6c084a413516f /klippy/configfile.py
parent4d0d219716afb1143119d7e919fa1e896a896f11 (diff)
downloadkutter-a8e3afd64aa5db4ea2b846c13be7faf501b20f51.tar.gz
kutter-a8e3afd64aa5db4ea2b846c13be7faf501b20f51.tar.xz
kutter-a8e3afd64aa5db4ea2b846c13be7faf501b20f51.zip
configfile: report "save_config_pending" via get_status() (#3372)
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'klippy/configfile.py')
-rw-r--r--klippy/configfile.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/klippy/configfile.py b/klippy/configfile.py
index 6530331c..6ea6e550 100644
--- a/klippy/configfile.py
+++ b/klippy/configfile.py
@@ -94,6 +94,7 @@ class PrinterConfig:
self.printer = printer
self.autosave = None
self.status_info = {}
+ self.save_config_pending = False
gcode = self.printer.lookup_object('gcode')
gcode.register_command("SAVE_CONFIG", self.cmd_SAVE_CONFIG,
desc=self.cmd_SAVE_CONFIG_help)
@@ -259,16 +260,19 @@ class PrinterConfig:
for option in section.get_prefix_options(''):
section_status[option] = section.get(option, note_valid=False)
def get_status(self, eventtime):
- return {'config': self.status_info}
+ return {'config': self.status_info,
+ 'save_config_pending': self.save_config_pending}
# Autosave functions
def set(self, section, option, value):
if not self.autosave.fileconfig.has_section(section):
self.autosave.fileconfig.add_section(section)
svalue = str(value)
self.autosave.fileconfig.set(section, option, svalue)
+ self.save_config_pending = True
logging.info("save_config: set [%s] %s = %s", section, option, svalue)
def remove_section(self, section):
self.autosave.fileconfig.remove_section(section)
+ self.save_config_pending = True
def _disallow_include_conflicts(self, regular_data, cfgname, gcode):
config = self._build_config_wrapper(regular_data, cfgname)
for section in self.autosave.fileconfig.sections():