configfile: add get_prefix_options method

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
This commit is contained in:
Janar Sööt 2018-09-29 12:15:48 +03:00 committed by Kevin O'Connor
parent 8c2991ceac
commit d9e35481be
1 changed files with 3 additions and 0 deletions

View File

@ -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 ---------------------->