diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2011-09-17 17:39:53 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2011-09-17 17:39:53 +0100 |
commit | 098577ab640e387069b2c2546581ed677fc810a8 (patch) | |
tree | f2ca7b63deab6cb46977644510b9d7000ffa83d4 /alot | |
parent | b4b2e7c7affcd5a9fb776da6b9820d170fd8aab8 (diff) |
more liberal lookup for accounts
Diffstat (limited to 'alot')
-rw-r--r-- | alot/account.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/alot/account.py b/alot/account.py index 73d37377..74e9beea 100644 --- a/alot/account.py +++ b/alot/account.py @@ -228,8 +228,9 @@ class AccountManager: :rtype: `account.Account` or None """ - if address in self.accountmap: - return self.accountmap[address] + for myad in self.get_addresses(): + if myad in address: + return self.accountmap[myad] else: return None # log info @@ -243,7 +244,11 @@ class AccountManager: return self.accountmap.keys() def get_addressbooks(self, order=[], append_remaining=True): - abooks = [a.abook for a in order] + abooks = [] + for a in order: + if a: + if a.abook: + abooks.append(a.abook) if append_remaining: for a in self.accounts: if a.abook and a.abook not in abooks: |