diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-04-20 13:30:58 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-04-20 13:38:08 -0400 |
commit | eff1c8604d42294f095d5cb25de4d65fae693240 (patch) | |
tree | f131c7f36687b2c46198299fd40db7f8b424f328 | |
parent | 85e6cd865c7e6e053971cac456155e5fbd97ccd6 (diff) | |
download | kutter-eff1c8604d42294f095d5cb25de4d65fae693240.tar.gz kutter-eff1c8604d42294f095d5cb25de4d65fae693240.tar.xz kutter-eff1c8604d42294f095d5cb25de4d65fae693240.zip |
klippy: Reword the error messages during config file parsing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/klippy.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/klippy/klippy.py b/klippy/klippy.py index 9532b911..b05bcb12 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -104,8 +104,8 @@ class ConfigWrapper: c = self.get(option, default) if c not in choices: raise self.error( - "Option '%s' in section '%s' is not a valid choice" % ( - option, self.section)) + "Choice '%s' for option '%s' in section '%s'" + " is not a valid choice" % (c, option, self.section)) return choices[c] def getsection(self, section): return ConfigWrapper(self.printer, self.fileconfig, section) @@ -215,13 +215,13 @@ class Printer: for section in fileconfig.sections(): section = section.lower() if section not in valid_sections and section not in self.objects: - raise self.config_error("Unknown config file section '%s'" % ( - section,)) + raise self.config_error( + "Section '%s' is not a valid config section" % (section,)) for option in fileconfig.options(section): option = option.lower() if (section, option) not in self.all_config_options: raise self.config_error( - "Unknown option '%s' in section '%s'" % ( + "Option '%s' is not valid in section '%s'" % ( option, section)) # Determine which printer objects have stats/state callbacks self.stats_cb = [o.stats for o in self.objects.values() |