summaryrefslogtreecommitdiffstats
path: root/aurweb/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'aurweb/config.py')
-rw-r--r--aurweb/config.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/aurweb/config.py b/aurweb/config.py
index a52d9422..52ec461e 100644
--- a/aurweb/config.py
+++ b/aurweb/config.py
@@ -8,11 +8,13 @@ def _get_parser():
global _parser
if not _parser:
+ path = os.environ.get('AUR_CONFIG', '/etc/aurweb/config')
+ defaults = os.environ.get('AUR_CONFIG_DEFAULTS', path + '.defaults')
+
_parser = configparser.RawConfigParser()
- if 'AUR_CONFIG' in os.environ:
- path = os.environ.get('AUR_CONFIG')
- else:
- path = "/etc/aurweb/config"
+ if os.path.isfile(defaults):
+ with open(defaults) as f:
+ _parser.read_file(f)
_parser.read(path)
return _parser