From 459377b1424633bc4f322a6389fcccaa7628e91d Mon Sep 17 00:00:00 2001 From: Julian Mehne Date: Fri, 19 Jan 2018 11:01:23 +0100 Subject: Move processing of setting to the right place. --- alot/commands/globals.py | 6 ------ alot/settings/manager.py | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'alot') 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') -- cgit v1.2.3