mirror of
https://github.com/pulb/mailnag.git
synced 2026-05-07 11:16:49 +02:00
Removed unnecessary code from Account class, because both POP3 and IMAP is now
handled same way.
This commit is contained in:
@@ -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
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user