summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorJakob <jakob@pipefour.org>2012-04-03 10:34:18 -0700
committerJakob <jakob@pipefour.org>2012-04-03 10:34:18 -0700
commitd70e88266c76d485f068c36aa6072392e599838c (patch)
treee813fe62200e3307f4c7872ebbf508b459405a7d /alot
parent287884e39e4d220ba78d8aeb1456be5ebd550ccc (diff)
Don't try to autocomplete blank email addresses.
If the email section is missing entirely, configobj defaults to an empty list. But if it's present and empty ("email="), then it becomes a list of one blank string. Ignore these. Also, fix spacing since I was using hard tabs.
Diffstat (limited to 'alot')
-rw-r--r--alot/addressbooks.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/alot/addressbooks.py b/alot/addressbooks.py
index 47e77266..f527492f 100644
--- a/alot/addressbooks.py
+++ b/alot/addressbooks.py
@@ -44,11 +44,11 @@ class AbookAddressBook(AddressBook):
def get_contacts(self):
c = self._config
- res = []
- for id in c.sections:
- for email in c[id]['email']:
- res.append((c[id]['name'], email))
- return res
+ res = []
+ for id in c.sections:
+ for email in c[id]['email']:
+ if email: res.append((c[id]['name'], email))
+ return res
class MatchSdtoutAddressbook(AddressBook):