diff --git a/weboob/config.py b/weboob/config.py index 581e35b7df77f607916ac20bc1b9d4544f85071b..186c6ebf607b823c0ef4ec4194ca58d80414fb73 100644 --- a/weboob/config.py +++ b/weboob/config.py @@ -43,6 +43,25 @@ def __init__(self, path): self.path = path self.sections = {} + def get(self, *args): + s = None + path = '' + for a in args: + if path: path += '.' + path += a + if not s: + try: + s = self.sections[a] + except KeyError: + s = self.sections[a] = Section(path) + else: + try: + s = s.values[a] + except KeyError: + s = s.values[a] = Section(path) + + return s + def load(self): parser = SafeConfigParser() parser.read(self.path)