aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/display/menu.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-09-04 20:49:47 -0400
committerKevinOConnor <kevin@koconnor.net>2018-09-25 13:48:46 -0400
commitf80456a6983566ae073e477b9033090263c4745d (patch)
tree4a977a3091288ad1a83321487ee61ba9d5f13dea /klippy/extras/display/menu.py
parent5144c5f01e82c07e332703cce27ce0aa6890b234 (diff)
downloadkutter-f80456a6983566ae073e477b9033090263c4745d.tar.gz
kutter-f80456a6983566ae073e477b9033090263c4745d.tar.xz
kutter-f80456a6983566ae073e477b9033090263c4745d.zip
configfile: Move config file code from klippy.py to new file
Add a klippy/configfile.py file with the code needed to read the main printer config file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/display/menu.py')
-rw-r--r--klippy/extras/display/menu.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/klippy/extras/display/menu.py b/klippy/extras/display/menu.py
index c32d9ed3..a8c74341 100644
--- a/klippy/extras/display/menu.py
+++ b/klippy/extras/display/menu.py
@@ -5,9 +5,7 @@
# Copyright (C) 2018 Janar Sööt <janar.soot@gmail.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
-import os, ConfigParser, logging
-import sys, ast, re
-import klippy
+import os, logging, sys, ast, re
class error(Exception):
@@ -963,10 +961,9 @@ class MenuManager:
desc=self.cmd_DO_help)
# Parse local config file in same directory as current module
- fileconfig = ConfigParser.RawConfigParser()
+ pconfig = self.printer.lookup_object('configfile')
localname = os.path.join(os.path.dirname(__file__), 'menu.cfg')
- fileconfig.read(localname)
- localconfig = klippy.ConfigWrapper(self.printer, fileconfig, {}, None)
+ localconfig = pconfig.read_config(localname)
# Load items from local config
self.load_menuitems(localconfig)