aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-12-22 20:06:15 -0500
committerKevin O'Connor <kevin@koconnor.net>2020-12-22 20:06:15 -0500
commitca8e6ad89beb7d372c80a2d40b64a3bd48b21ac9 (patch)
tree9b0bfe5171576966538424465d16fc0efea1ccbb /klippy
parentac98d0ea7e8f636b25d28e99a1e9c72de378be93 (diff)
downloadkutter-ca8e6ad89beb7d372c80a2d40b64a3bd48b21ac9.tar.gz
kutter-ca8e6ad89beb7d372c80a2d40b64a3bd48b21ac9.tar.xz
kutter-ca8e6ad89beb7d372c80a2d40b64a3bd48b21ac9.zip
configfile: Minor line wrapping changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/configfile.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/klippy/configfile.py b/klippy/configfile.py
index 6ea6e550..f21c4779 100644
--- a/klippy/configfile.py
+++ b/klippy/configfile.py
@@ -33,22 +33,20 @@ class ConfigWrapper:
except self.error as e:
raise
except:
- raise error("Unable to parse option '%s' in section '%s'" % (
- option, self.section))
+ raise error("Unable to parse option '%s' in section '%s'"
+ % (option, self.section))
if minval is not None and v < minval:
- raise error(
- "Option '%s' in section '%s' must have minimum of %s" % (
- option, self.section, minval))
+ raise error("Option '%s' in section '%s' must have minimum of %s"
+ % (option, self.section, minval))
if maxval is not None and v > maxval:
- raise error(
- "Option '%s' in section '%s' must have maximum of %s" % (
- option, self.section, maxval))
+ raise error("Option '%s' in section '%s' must have maximum of %s"
+ % (option, self.section, maxval))
if above is not None and v <= above:
- raise error("Option '%s' in section '%s' must be above %s" % (
- option, self.section, above))
+ raise error("Option '%s' in section '%s' must be above %s"
+ % (option, self.section, above))
if below is not None and v >= below:
- raise self.error("Option '%s' in section '%s' must be below %s" % (
- option, self.section, below))
+ raise self.error("Option '%s' in section '%s' must be below %s"
+ % (option, self.section, below))
return v
def get(self, option, default=sentinel, note_valid=True):
return self._get_wrapper(self.fileconfig.get, option, default,
@@ -240,13 +238,13 @@ class PrinterConfig:
for section_name in fileconfig.sections():
section = section_name.lower()
if section not in valid_sections and section not in objects:
- raise error("Section '%s' is not a valid config section" % (
- section,))
+ raise error("Section '%s' is not a valid config section"
+ % (section,))
for option in fileconfig.options(section_name):
option = option.lower()
if (section, option) not in access_tracking:
- raise error("Option '%s' is not valid in section '%s'" % (
- option, section))
+ raise error("Option '%s' is not valid in section '%s'"
+ % (option, section))
def log_config(self, config):
lines = ["===== Config file =====",
self._build_config_string(config),
@@ -278,8 +276,8 @@ class PrinterConfig:
for section in self.autosave.fileconfig.sections():
for option in self.autosave.fileconfig.options(section):
if config.fileconfig.has_option(section, option):
- msg = "SAVE_CONFIG section '%s' option '%s' conflicts " \
- "with included value" % (section, option)
+ msg = ("SAVE_CONFIG section '%s' option '%s' conflicts "
+ "with included value" % (section, option))
raise gcode.error(msg)
cmd_SAVE_CONFIG_help = "Overwrite config file and restart"
def cmd_SAVE_CONFIG(self, gcmd):