aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/configfile.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-10-06 14:07:32 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-10-06 14:07:32 -0400
commitc7b65f50e3cd5a3adcab2fdd974ca876ae2cfbe1 (patch)
treee0322eb29e5acab5d43ffb7bd76262735a8a7850 /klippy/configfile.py
parentcc63fd51b226f86aa684342241c20e2e2b84f8da (diff)
downloadkutter-c7b65f50e3cd5a3adcab2fdd974ca876ae2cfbe1.tar.gz
kutter-c7b65f50e3cd5a3adcab2fdd974ca876ae2cfbe1.tar.xz
kutter-c7b65f50e3cd5a3adcab2fdd974ca876ae2cfbe1.zip
configfile: Ignore trailing comments starting with a semicolon
Newer versions of configparser no longer default to ignoring trailing comments that start with a semicolon. Add that setting explicitly to avoid breaking existing config files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/configfile.py')
-rw-r--r--klippy/configfile.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/configfile.py b/klippy/configfile.py
index 71f5ca60..55aed295 100644
--- a/klippy/configfile.py
+++ b/klippy/configfile.py
@@ -255,7 +255,8 @@ class PrinterConfig:
self._parse_config_buffer(buffer, filename, fileconfig)
visited.remove(path)
def _build_config_wrapper(self, data, filename):
- fileconfig = configparser.RawConfigParser(strict=False)
+ fileconfig = configparser.RawConfigParser(
+ strict=False, inline_comment_prefixes=(';','#'))
self._parse_config(data, filename, fileconfig, set())
return ConfigWrapper(self.printer, fileconfig, {}, 'printer')
def _build_config_string(self, config):