mirror of https://github.com/Desuuuu/klipper.git
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>
This commit is contained in:
parent
cc63fd51b2
commit
c7b65f50e3
|
@ -255,7 +255,8 @@ class PrinterConfig:
|
||||||
self._parse_config_buffer(buffer, filename, fileconfig)
|
self._parse_config_buffer(buffer, filename, fileconfig)
|
||||||
visited.remove(path)
|
visited.remove(path)
|
||||||
def _build_config_wrapper(self, data, filename):
|
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())
|
self._parse_config(data, filename, fileconfig, set())
|
||||||
return ConfigWrapper(self.printer, fileconfig, {}, 'printer')
|
return ConfigWrapper(self.printer, fileconfig, {}, 'printer')
|
||||||
def _build_config_string(self, config):
|
def _build_config_string(self, config):
|
||||||
|
|
Loading…
Reference in New Issue