diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-03-11 13:31:18 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-03-11 13:32:55 +0000 |
commit | cc0a67526088df5626be6e6567e3fb5788ec84b4 (patch) | |
tree | 2ddec4045ed8346aa557d14babfed7d87a277f88 /alot/account.py | |
parent | e6e02c30cc31e7225f3c6c9316df42424cddc5ca (diff) |
cleanup Account.__init__ wrt. sent/draft boxes
sent_box and draft_box are already provided as Mailbox
objects so don't have to be interpreted/instanciated
here
Diffstat (limited to 'alot/account.py')
-rw-r--r-- | alot/account.py | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/alot/account.py b/alot/account.py index 88d2ce10..0e590953 100644 --- a/alot/account.py +++ b/alot/account.py @@ -6,7 +6,6 @@ import email import os import glob import shlex -from urlparse import urlparse import helper @@ -50,44 +49,17 @@ class Account(object): sent_tags=['sent'], draft_box=None, draft_tags=['draft'], abook=None, **rest): self.address = address - self.abook = abook - self.aliases = [] self.aliases = aliases self.realname = realname self.gpg_key = gpg_key self.signature = signature self.signature_filename = signature_filename self.signature_as_attachment = signature_as_attachment - - self.sent_box = None - if sent_box: - mburl = urlparse(sent_box) - if mburl.scheme == 'mbox': - self.sent_box = mailbox.mbox(mburl.path) - elif mburl.scheme == 'maildir': - self.sent_box = mailbox.Maildir(mburl.path) - elif mburl.scheme == 'mh': - self.sent_box = mailbox.MH(mburl.path) - elif mburl.scheme == 'babyl': - self.sent_box = mailbox.Babyl(mburl.path) - elif mburl.scheme == 'mmdf': - self.sent_box = mailbox.MMDF(mburl.path) + self.sent_box = sent_box self.sent_tags = sent_tags - - self.draft_box = None - if draft_box: - mburl = urlparse(draft_box) - if mburl.scheme == 'mbox': - self.draft_box = mailbox.mbox(mburl.path) - elif mburl.scheme == 'maildir': - self.draft_box = mailbox.Maildir(mburl.path) - elif mburl.scheme == 'mh': - self.draft_box = mailbox.MH(mburl.path) - elif mburl.scheme == 'babyl': - self.draft_box = mailbox.Babyl(mburl.path) - elif mburl.scheme == 'mmdf': - self.draft_box = mailbox.MMDF(mburl.path) + self.draft_box = draft_box self.draft_tags = draft_tags + self.abook = abook def get_addresses(self): """return all email addresses connected to this account, in order of |