Removed unnecessary code from Account class, because both POP3 and IMAP is now

handled same way.
This commit is contained in:
Timo Kankare
2016-09-06 17:35:24 +03:00
parent f9dde27aff
commit 94e3e6705e

View File

@@ -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
#