diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-01-25 09:36:23 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2017-01-25 10:37:20 -0800 |
commit | de85d34545fc8f67b80697a73a2d676b740e9ddd (patch) | |
tree | 368c4bf753d9549c0182a8a66035a0429f823530 /alot | |
parent | 0ec97d98e82d10024419199b93c1d13a1cedc5eb (diff) |
move alot/settings/checks to alot/utils/configobj
This is just more reorganization.
Diffstat (limited to 'alot')
-rw-r--r-- | alot/settings/manager.py | 19 | ||||
-rw-r--r-- | alot/settings/theme.py | 13 | ||||
-rw-r--r-- | alot/utils/configobj.py (renamed from alot/settings/checks.py) | 3 |
3 files changed, 15 insertions, 20 deletions
diff --git a/alot/settings/manager.py b/alot/settings/manager.py index 5e9727f8..074622d6 100644 --- a/alot/settings/manager.py +++ b/alot/settings/manager.py @@ -14,15 +14,11 @@ from ..account import SendmailAccount from ..addressbook.abook import AbookAddressBook from ..addressbook.external import ExternalAddressbook from ..helper import pretty_datetime, string_decode +from ..utils import configobj as checks from .errors import ConfigError from .utils import read_config from .utils import resolve_att -from .checks import force_list -from .checks import mail_container -from .checks import gpg_key -from .checks import attr_triple -from .checks import align_mode from .theme import Theme @@ -60,12 +56,13 @@ class SettingsManager(object): def read_config(self, path): """parse alot's config file from path""" spec = os.path.join(DEFAULTSPATH, 'alot.rc.spec') - newconfig = read_config(path, spec, - checks={'mail_container': mail_container, - 'force_list': force_list, - 'align': align_mode, - 'attrtriple': attr_triple, - 'gpg_key_hint': gpg_key}) + newconfig = read_config( + path, spec, checks={ + 'mail_container': checks.mail_container, + 'force_list': checks.force_list, + 'align': checks.align_mode, + 'attrtriple': checks.attr_triple, + 'gpg_key_hint': checks.gpg_key}) self._config.merge(newconfig) hooks_path = os.path.expanduser(self._config.get('hooksfile')) diff --git a/alot/settings/theme.py b/alot/settings/theme.py index c05a4db0..f2a59763 100644 --- a/alot/settings/theme.py +++ b/alot/settings/theme.py @@ -5,11 +5,8 @@ from __future__ import absolute_import import os +from ..utils import configobj as checks from .utils import read_config -from .checks import align_mode -from .checks import attr_triple -from .checks import width_tuple -from .checks import force_list from .errors import ConfigError DEFAULTSPATH = os.path.join(os.path.dirname(__file__), '..', 'defaults') @@ -26,10 +23,10 @@ class Theme(object): """ self._spec = os.path.join(DEFAULTSPATH, 'theme.spec') self._config = read_config(path, self._spec, - checks={'align': align_mode, - 'widthtuple': width_tuple, - 'force_list': force_list, - 'attrtriple': attr_triple}) + checks={'align': checks.align_mode, + 'widthtuple': checks.width_tuple, + 'force_list': checks.force_list, + 'attrtriple': checks.attr_triple}) self._colours = [1, 16, 256] # make sure every entry in 'order' lists have their own subsections threadline = self._config['search']['threadline'] diff --git a/alot/settings/checks.py b/alot/utils/configobj.py index 125d1860..aba61c3d 100644 --- a/alot/settings/checks.py +++ b/alot/utils/configobj.py @@ -5,11 +5,12 @@ from __future__ import absolute_import import mailbox import re -from urwid import AttrSpec, AttrSpecError from urlparse import urlparse + from validate import VdtTypeError from validate import is_list from validate import ValidateError, VdtValueTooLongError, VdtValueError +from urwid import AttrSpec, AttrSpecError from .. import crypto from ..errors import GPGProblem |