diff options
author | Ruben Pollan <meskio@sindominio.net> | 2015-01-14 13:50:02 -0600 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-01-21 15:07:19 -0400 |
commit | c13e17114cfb58acc4911ed98c367faf47717ec0 (patch) | |
tree | c865ba8310b6440ed804013a61a70cb57a01d0c8 /src/leap/mail/mail.py | |
parent | 16f7099a8c7c1dd31f1b8bab78cc6554a01d63c7 (diff) |
Refactor fetch into leap.mail.incoming IService
Diffstat (limited to 'src/leap/mail/mail.py')
-rw-r--r-- | src/leap/mail/mail.py | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/leap/mail/mail.py b/src/leap/mail/mail.py index 8137f97..cb37d25 100644 --- a/src/leap/mail/mail.py +++ b/src/leap/mail/mail.py @@ -414,15 +414,10 @@ class MessageCollection(object): # Manipulate messages - def add_msg(self, raw_msg, flags=None, tags=None, date=None): + def add_msg(self, raw_msg, flags=tuple(), tags=tuple(), date=""): """ Add a message to this collection. """ - if not flags: - flags = tuple() - if not tags: - tags = tuple() - leap_assert_type(flags, tuple) leap_assert_type(date, str) @@ -582,7 +577,6 @@ class Account(object): self.mbox_indexer = MailboxIndexer(self.store) self.deferred_initialization = defer.Deferred() - self._initialized = False self._ready_cb = ready_cb self._init_d = self._initialize_storage() @@ -594,7 +588,6 @@ class Account(object): return self.add_mailbox(INBOX_NAME) def finish_initialization(result): - self._initialized = True self.deferred_initialization.callback(None) if self._ready_cb is not None: self._ready_cb() @@ -606,12 +599,8 @@ class Account(object): return d def callWhenReady(self, cb, *args, **kw): - if self._initialized: - cb(self, *args, **kw) - return defer.succeed(None) - else: - self.deferred_initialization.addCallback(cb, *args, **kw) - return self.deferred_initialization + self.deferred_initialization.addCallback(cb, *args, **kw) + return self.deferred_initialization # # Public API Starts |