vladimarius / imapy

Imapy: Imap for Humans
230 stars 22 forks source link

make IMAP-class a contextmanager #7

Closed woutervh closed 8 years ago

woutervh commented 9 years ago
class IMAP:

    ...
    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        self.logout()
with imapy.connect(host='imap.gmail.com', username='imapy@gmail.com',password='secret',ssl=True) 
as box:
    box.folders()

#box.logout()   is no longer necesarry
woutervh commented 9 years ago

See my changes: https://github.com/WouterVH/imapy/commit/d93474e9e83c31d035e75543c318f1f7e81a785f

vladimarius commented 8 years ago

Fixed in 1.1.0

woutervh commented 8 years ago

I don't see it in v1.1.0.

woutervh commented 8 years ago

I cannot re-open this ticket myself.

woutervh commented 8 years ago

@vladimarius ping.

vladimarius commented 8 years ago

please check latest version from pip