aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-06-12 10:03:28 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-06-15 17:15:53 -0400
commita1fc1ac214a6178b59229b0c87179a8444697e02 (patch)
tree35abc1f225307494b68c69f18ed917a680a47d94 /klippy
parent40da3f406aa8e6e135da2805e7a5b5995e8274a5 (diff)
downloadkutter-a1fc1ac214a6178b59229b0c87179a8444697e02.tar.gz
kutter-a1fc1ac214a6178b59229b0c87179a8444697e02.tar.xz
kutter-a1fc1ac214a6178b59229b0c87179a8444697e02.zip
configfile: Use "import ConfigParser as configparser"
This minor change makes it easier to port the code to Python3. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/configfile.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/klippy/configfile.py b/klippy/configfile.py
index 8cff4a5b..6530331c 100644
--- a/klippy/configfile.py
+++ b/klippy/configfile.py
@@ -3,15 +3,15 @@
# Copyright (C) 2016-2018 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
-import os, glob, re, time, logging, ConfigParser, StringIO
+import os, glob, re, time, logging, ConfigParser as configparser, StringIO
-error = ConfigParser.Error
+error = configparser.Error
class sentinel:
pass
class ConfigWrapper:
- error = ConfigParser.Error
+ error = configparser.Error
def __init__(self, printer, fileconfig, access_tracking, section):
self.printer = printer
self.fileconfig = fileconfig
@@ -194,7 +194,7 @@ class PrinterConfig:
if pos >= 0:
line = line[:pos]
# Process include or buffer line
- mo = ConfigParser.RawConfigParser.SECTCRE.match(line)
+ mo = configparser.RawConfigParser.SECTCRE.match(line)
header = mo and mo.group('header')
if header and header.startswith('include '):
self._parse_config_buffer(buffer, filename, fileconfig)
@@ -206,7 +206,7 @@ class PrinterConfig:
self._parse_config_buffer(buffer, filename, fileconfig)
visited.remove(path)
def _build_config_wrapper(self, data, filename):
- fileconfig = ConfigParser.RawConfigParser()
+ fileconfig = configparser.RawConfigParser()
self._parse_config(data, filename, fileconfig, set())
return ConfigWrapper(self.printer, fileconfig, {}, 'printer')
def _build_config_string(self, config):