summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorJulian Mehne <julian.mehne@posteo.de>2018-01-19 11:01:23 +0100
committerJulian Mehne <julian.mehne@posteo.de>2018-01-21 20:10:09 +0100
commit459377b1424633bc4f322a6389fcccaa7628e91d (patch)
treef36a9c3234539afb5670bfbc622b4bb75d567883 /alot
parentb9cbd26cbff48aa1a70a857210382a84503f60e2 (diff)
Move processing of setting to the right place.
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/globals.py6
-rw-r--r--alot/settings/manager.py9
2 files changed, 9 insertions, 6 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 8538bc1c..68f0a906 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -756,12 +756,6 @@ class ComposeCommand(Command):
if self.template is not None:
# get location of tempsdir, containing msg templates
tempdir = settings.get('template_dir')
- if tempdir:
- tempdir = os.path.expanduser(tempdir)
- else:
- xdgdir = os.environ.get('XDG_CONFIG_HOME',
- os.path.expanduser('~/.config'))
- tempdir = os.path.join(xdgdir, 'alot', 'templates')
path = os.path.expanduser(self.template)
if not os.path.dirname(path): # use tempsdir
diff --git a/alot/settings/manager.py b/alot/settings/manager.py
index dffe1b32..29475526 100644
--- a/alot/settings/manager.py
+++ b/alot/settings/manager.py
@@ -96,6 +96,15 @@ class SettingsManager(object):
newbindings = newconfig['bindings']
if isinstance(newbindings, Section):
self._bindings.merge(newbindings)
+
+ tempdir = self._config.get('template_dir')
+ if tempdir:
+ tempdir = os.path.expanduser(tempdir)
+ else:
+ xdgdir = os.environ.get('XDG_CONFIG_HOME',
+ os.path.expanduser('~/.config'))
+ tempdir = os.path.join(xdgdir, 'alot', 'templates')
+
# themes
themestring = newconfig['theme']
themes_dir = self._config.get('themes_dir')