diff options
author | MaZderMind <github@mazdermind.de> | 2015-05-10 21:14:09 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-05-10 21:14:09 +0200 |
commit | 80d57d8006a5af2854efa195c49c6f5edd5f93b1 (patch) | |
tree | f946b6ce3f9305a7e8d8761e2630b07d32273ef1 /voctocore/lib/config.py | |
parent | ff90df796c715ee9c95fb8a2152cea2698fe92ab (diff) |
Allow Parsing an extra File via Command-Line
Diffstat (limited to 'voctocore/lib/config.py')
-rw-r--r-- | voctocore/lib/config.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/voctocore/lib/config.py b/voctocore/lib/config.py index 88e713c..fdd2360 100644 --- a/voctocore/lib/config.py +++ b/voctocore/lib/config.py @@ -1,5 +1,6 @@ import os.path from configparser import SafeConfigParser +from lib.args import Args __all__ = ['Config'] @@ -8,9 +9,14 @@ def getlist(self, section, option): SafeConfigParser.getlist = getlist -Config = SafeConfigParser() -Config.read([ +files = [ 'default-config.ini', '/etc/voctomix.ini', - os.path.expanduser('~/.voctomix.ini') -]) + os.path.expanduser('~/.voctomix.ini'), +] + +if Args.ini_file is not None: + files.append(Args.ini_file) + +Config = SafeConfigParser() +Config.read(files) |