From d9e35481bedd5de04800120befc0e94b5877ecd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janar=20S=C3=B6=C3=B6t?= Date: Sat, 29 Sep 2018 12:15:48 +0300 Subject: [PATCH] configfile: add get_prefix_options method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Janar Sööt --- klippy/configfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/klippy/configfile.py b/klippy/configfile.py index b8945462..57e61740 100644 --- a/klippy/configfile.py +++ b/klippy/configfile.py @@ -74,6 +74,9 @@ class ConfigWrapper: def get_prefix_sections(self, prefix): return [self.getsection(s) for s in self.fileconfig.sections() if s.startswith(prefix)] + def get_prefix_options(self, prefix): + return [o for o in self.fileconfig.options(self.section) + if o.startswith(prefix)] AUTOSAVE_HEADER = """ #*# <---------------------- SAVE_CONFIG ---------------------->