예제 #1
0
파일: imap.py 프로젝트: nicolas33/imapfw
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
예제 #2
0
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()
예제 #3
0
파일: imap.py 프로젝트: nicolas33/imapfw
 def __init__(self, *args):
     super(Imap, self).__init__(*args)
     self.imap = ImapBackend(self.conf.get('backend'))
     self.imap.configure()