From eff1c8604d42294f095d5cb25de4d65fae693240 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 20 Apr 2018 13:30:58 -0400 Subject: [PATCH] klippy: Reword the error messages during config file parsing Signed-off-by: Kevin O'Connor --- klippy/klippy.py | 10 +++++----- 1 file 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()