From: Michael Tremer Date: Sat, 3 Dec 2016 10:45:27 +0000 (+0100) Subject: config: Add function to read configuration from string X-Git-Tag: 0.9.28~1285^2~1425 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61e181f18109d35850e690b28b608feeb2b75046;p=pakfire.git config: Add function to read configuration from string Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/config.py b/src/pakfire/config.py index 66c1d957b..2d2fdc27a 100644 --- a/src/pakfire/config.py +++ b/src/pakfire/config.py @@ -55,6 +55,12 @@ class Config(object): with open(path) as f: self._config.readfp(f) + def parse(self, s): + """ + Takes configuration as a string and parses it + """ + self._config.read_string(s) + def get(self, section, option, default=None): return self._config.get(section, option, fallback=default)