summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-08-01 09:05:07 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2012-08-01 09:05:07 +0100
commitf050a250526dfc38336150518819aa2d7bfadd72 (patch)
tree697eb35343f7b9eb7e24a1272e246bd1fec14be2
parent0cc29f4b48dc8f128d0cdf9d3ff4e328a8dfc454 (diff)
do not write default config if missing
This has been done before to provide the default bindings, which are now read directly from defautls/default.bindings during startup.
-rw-r--r--alot/defaults/config.stub93
-rwxr-xr-xalot/init.py4
-rw-r--r--alot/settings/__init__.py12
-rw-r--r--alot/settings/utils.py2
4 files changed, 1 insertions, 110 deletions
diff --git a/alot/defaults/config.stub b/alot/defaults/config.stub
deleted file mode 100644
index 94f78c4d..00000000
--- a/alot/defaults/config.stub
+++ /dev/null
@@ -1,93 +0,0 @@
-# For a complete list and description of options, please refer to:
-# http://alot.readthedocs.org/en/latest/configuration/index.html#config-options
-
-# editor command
-# if unset, alot will first try the EDITOR env variable, then file /usr/bin/editor
-#editor_cmd = nano
-
-#[accounts]
-# [[foo-account]]
-# # your main email address
-# address = me@example.com
-#
-# # used to format the (proposed) From-header in outgoing mails
-# realname = string
-#
-# # used to clear your addresses/ match account when formatting replies
-# aliases = foo@bar.com, foo@barmail.com
-#
-# # where to store outgoing mails and drafts
-# sent_box = maildir:///home/you/mail/Sent
-# draft_box = maildir:///home/you/mail/Drafts
-#
-# # list of tags to automatically add to outgoing messages
-# sent_tags = sent,
-
-
-[bindings]
- j = move down
- k = move up
- ' ' = move page down
- esc = cancel
- enter = select
- @ = refresh
- ? = help bindings
- I = search tag:inbox AND NOT tag:killed
- L = taglist
- shift tab = bprevious
- U = search tag:unread
- tab = bnext
- \ = prompt 'search '
- d = bclose
- $ = flush
- m = compose
- o = prompt 'search '
- q = exit
- ';' = bufferlist
- ':' = prompt
-
- [[bufferlist]]
- x = close
- select = openfocussed
-
- [[search]]
- a = toggletags inbox
- & = toggletags killed
- ! = toggletags flagged
- s = toggletags unread
- l = retagprompt
- O = refineprompt
- | = refineprompt
-
- [[envelope]]
- a = prompt 'attach ~/'
- y = send
- P = save
- s = 'refine Subject'
- t = 'refine To'
- b = 'refine Bcc'
- c = 'refine Cc'
- S = togglesign
- select = edit
- H = toggleheaders
-
- [[taglist]]
-
- [[thread]]
- C = fold --all
- E = unfold --all
- c = fold
- e = unfold
- < = fold
- > = unfold
- H = toggleheaders
- h = togglesource
- P = print --all --separately --add_tags
- S = save --all
- g = reply --all
- f = forward
- p = print --add_tags
- n = editnew
- s = save
- r = reply
- | = prompt 'pipeto '
diff --git a/alot/init.py b/alot/init.py
index ced647eb..aaa2f22c 100755
--- a/alot/init.py
+++ b/alot/init.py
@@ -152,10 +152,6 @@ def main():
break # use only the first
try:
- if not alotconfig:
- alotconfig = configfiles[0]
- settings.write_default_config(alotconfig)
-
settings.read_config(alotconfig)
settings.read_notmuch_config(notmuchconfig)
except (ConfigError, OSError, IOError), e:
diff --git a/alot/settings/__init__.py b/alot/settings/__init__.py
index 35599fa8..a92eaf0e 100644
--- a/alot/settings/__init__.py
+++ b/alot/settings/__init__.py
@@ -102,18 +102,6 @@ class SettingsManager(object):
self._accounts = self._parse_accounts(self._config)
self._accountmap = self._account_table(self._accounts)
- def write_default_config(self, path):
- """write out defaults/config.stub to path"""
- (dir, file) = os.path.split(path)
- try:
- os.makedirs(dir)
- except OSError, e:
- if e.errno == errno.EEXIST:
- pass
- else:
- raise
- shutil.copyfile(os.path.join(DEFAULTSPATH, 'config.stub'), path)
-
def _parse_accounts(self, config):
"""
read accounts information from config
diff --git a/alot/settings/utils.py b/alot/settings/utils.py
index f6912f98..6b5f77cb 100644
--- a/alot/settings/utils.py
+++ b/alot/settings/utils.py
@@ -25,7 +25,7 @@ def read_config(configpath=None, specpath=None, checks={}):
config = ConfigObj(infile=configpath, configspec=specpath,
file_error=True, encoding='UTF8')
except (ConfigObjError, IOError):
- raise ConfigError('Couls not read %s' % configpath)
+ raise ConfigError('Could not read %s' % configpath)
except UnboundLocalError:
# this works around a bug in configobj
msg = '%s is malformed. Check for sections without parents..'