summaryrefslogtreecommitdiff
path: root/alot/settings/manager.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/settings/manager.py')
-rw-r--r--alot/settings/manager.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/alot/settings/manager.py b/alot/settings/manager.py
index 15f75cd0..d7a4b499 100644
--- a/alot/settings/manager.py
+++ b/alot/settings/manager.py
@@ -112,11 +112,12 @@ class SettingsManager:
self._notmuchconfig = None
self._config = ConfigObj()
self._bindings = None
+ self._config_paths = []
def reload(self):
"""Reload notmuch and alot config files"""
self.read_notmuch_config(self._notmuchconfig.filename)
- self.read_config(self._config.filename)
+ self.read_config(self._config_paths)
def read_notmuch_config(self, path):
"""
@@ -125,7 +126,7 @@ class SettingsManager:
:type path: str
"""
spec = os.path.join(DEFAULTSPATH, 'notmuch.rc.spec')
- self._notmuchconfig = read_config(path, spec)
+ self._notmuchconfig = read_config([path], spec)
def _update_bindings(self, newbindings):
assert isinstance(newbindings, Section)
@@ -134,14 +135,14 @@ class SettingsManager:
'default.bindings'))
self._bindings.merge(newbindings)
- def read_config(self, path):
+ def read_config(self, paths):
"""
parse alot's config file
- :param path: path to alot's config file
- :type path: str
+ :param paths: list of config file paths
+ :type path: list(str)
"""
spec = os.path.join(DEFAULTSPATH, 'alot.rc.spec')
- newconfig = read_config(path, spec, report_extra=True, checks={
+ newconfig = read_config(paths, spec, report_extra=True, checks={
'mail_container': checks.mail_container,
'force_list': checks.force_list,
'align': checks.align_mode,
@@ -150,6 +151,8 @@ class SettingsManager:
self._config.merge(newconfig)
self._config.walk(self._expand_config_values)
+ self._config_paths = paths
+
hooks_path = os.path.expanduser(self._config.get('hooksfile'))
if os.path.isfile(hooks_path):
try: