diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/pixelated/adapter/pixelated_mailboxes.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/service/pixelated/adapter/pixelated_mailboxes.py b/service/pixelated/adapter/pixelated_mailboxes.py index 4866dbe4..8a01f26f 100644 --- a/service/pixelated/adapter/pixelated_mailboxes.py +++ b/service/pixelated/adapter/pixelated_mailboxes.py @@ -3,6 +3,8 @@ from pixelated.adapter.pixelated_mailbox import PixelatedMailbox class PixelatedMailBoxes(): + + def __init__(self, account): self.account = account @@ -14,6 +16,9 @@ class PixelatedMailBoxes(): def drafts(self): return self._create_or_get('DRAFTS') + def trash(self): + return self._create_or_get('TRASH') + @property def mailboxes(self): return [PixelatedMailbox.create(self.account, leap_mailbox_name) for leap_mailbox_name in @@ -41,7 +46,4 @@ class PixelatedMailBoxes(): def mailbox_exists(self, name): return name.upper() in map(lambda x: x.upper(), self.account.mailboxes) - def trash(self): - if not self.mailbox_exists('TRASH'): - self.account.addMailbox('TRASH') - return PixelatedMailbox.create(self.account, 'TRASH') + |