X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_librarian%2Fconfig.py;h=b4a7b603d23d0fe06c4c693fb5081f0b29f9b6ad;hb=fdd6cc53446717d894f3e1122585a0efc8716e20;hp=cbf76b7aab2c8e168ae734d6b09f8055519c181d;hpb=8fdf6aab492482fcacad9ce2ec764bdc5bf76590;p=m_librarian.git diff --git a/m_librarian/config.py b/m_librarian/config.py index cbf76b7..b4a7b60 100755 --- a/m_librarian/config.py +++ b/m_librarian/config.py @@ -63,6 +63,18 @@ class ConfigWrapper(object): return default # Do not catch ValueError here, it must be propagated + def getlist(self, section, option, default=None, sep=None): + value = self.get(section, option) + if not value: + if default is None: + return [] + return default + return value.split(sep) + + def getpath(self, section, option, default=os.path.curdir): + path = self.get(section, option, default=default) + return os.path.expanduser(os.path.expandvars(path)) + def get_config(config_path=None): global _ml_config