class Imap(Driver): """Imap driver possibly redefined by the rascal.""" isLocal = False def __init__(self, *args): super(Imap, self).__init__(*args) self.imap = ImapBackend(self.conf.get('backend')) self.imap.configure() def connect(self): #TODO: if already connected, pass. return True #return self.imap.connect(host, port) def getFolders(self): return Folders(Folder(b'on'), Folder(b'imap'), Folder(b'side')) def logout(self): #self.imap.logout() pass
class Imap(Driver): """Imap driver possibly redefined by the rascal.""" isLocal = False def __init__(self, *args): super(Imap, self).__init__(*args) self.imap = ImapBackend(self.conf.get('backend')) def capability(self): return self.imap.capability() def connect(self): host = self.conf.get('host') port = int(self.conf.get('port')) return self.imap.connect(host, port) def getFolders(self) -> Folders: return self.imap.getFolders() def select(self, folder: Folder) -> None: #TODO return True def login(self) -> None: user = self.conf.get('username') password = self.conf.get('password') return self.imap.login(user, password) def logout(self) -> None: self.imap.logout()
def __init__(self, *args): super(Imap, self).__init__(*args) self.imap = ImapBackend(self.conf.get('backend')) self.imap.configure()