From 94e3e6705e60408c4c64da4579ca3badef3bbf38 Mon Sep 17 00:00:00 2001 From: Timo Kankare Date: Tue, 6 Sep 2016 17:35:24 +0300 Subject: [PATCH] Removed unnecessary code from Account class, because both POP3 and IMAP is now handled same way. --- Mailnag/common/accounts.py | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/Mailnag/common/accounts.py b/Mailnag/common/accounts.py index 0eb7350..9b2c8b6 100644 --- a/Mailnag/common/accounts.py +++ b/Mailnag/common/accounts.py @@ -68,10 +68,8 @@ class Account: def get_connection(self, use_existing = False): # get email server connection - if self.imap: - return self._get_IMAP_connection(use_existing) - else: - return self._get_POP3_connection(use_existing) + self._conn = self.backend.get_connection(use_existing) + return self._conn def close(self): @@ -87,10 +85,7 @@ class Account: # was called multiple times (with use_existing # set to False). def has_connection(self): - if self.imap: - return self._has_IMAP_connection() - else: - return self._has_POP3_connection() + return self.backend.has_connection() def list_messages(self): @@ -109,24 +104,6 @@ class Account: return str(hash(self.user + self.server + ', '.join(self.folders))) - def _has_IMAP_connection(self): - return self.backend.has_connection() - - - def _get_IMAP_connection(self, use_existing): - self._conn = self.backend.get_connection(use_existing) - return self._conn - - - def _has_POP3_connection(self): - return self.backend.has_connection() - - - def _get_POP3_connection(self, use_existing): - self._conn = self.backend.get_connection(use_existing) - return self._conn - - # # AccountManager class #