From 7b9190b8fc416f97c17ca6461dd73967813516c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 27 Jul 2004 05:07:19 +0000 Subject: Patch #998149: imaplib deleteacl and myrights. --- Doc/lib/libimaplib.tex | 8 ++++++++ Lib/imaplib.py | 15 +++++++++++++++ Misc/ACKS | 1 + Misc/NEWS | 2 ++ 4 files changed, 26 insertions(+) diff --git a/Doc/lib/libimaplib.tex b/Doc/lib/libimaplib.tex index 67da9ae..5717026 100644 --- a/Doc/lib/libimaplib.tex +++ b/Doc/lib/libimaplib.tex @@ -182,6 +182,10 @@ data = authobject(response) Delete old mailbox named \var{mailbox}. \end{methoddesc} +\begin{methoddesc}{deleteacl}{mailbox, who} + Delete the ACLs (remove any rights) set for who on mailbox. +\end{methoddesc} + \begin{methoddesc}{expunge}{} Permanently remove deleted items from selected mailbox. Generates an \samp{EXPUNGE} response for each deleted message. Returned data @@ -242,6 +246,10 @@ data = authobject(response) Returned data are tuples of message part envelope and data. \end{methoddesc} +\begin{methoddes}{myrights}{mailbox} + Show my ACLs for a mailbox (i.e. the rights that I have on mailbox). +\end{methoddesc} + \begin{methoddesc}{namespace}{} Returns IMAP namespaces as defined in RFC2342. \versionadded{2.3} diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 8ccf8b8..2bdabb2 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -46,12 +46,14 @@ Commands = { 'COPY': ('SELECTED',), 'CREATE': ('AUTH', 'SELECTED'), 'DELETE': ('AUTH', 'SELECTED'), + 'DELETEACL': ('AUTH', 'SELECTED'), 'EXAMINE': ('AUTH', 'SELECTED'), 'EXPUNGE': ('SELECTED',), 'FETCH': ('SELECTED',), 'GETACL': ('AUTH', 'SELECTED'), 'GETQUOTA': ('AUTH', 'SELECTED'), 'GETQUOTAROOT': ('AUTH', 'SELECTED'), + 'MYRIGHTS': ('AUTH', 'SELECTED'), 'LIST': ('AUTH', 'SELECTED'), 'LOGIN': ('NONAUTH',), 'LOGOUT': ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'), @@ -389,6 +391,12 @@ class IMAP4: """ return self._simple_command('DELETE', mailbox) + def deleteacl(self, mailbox, who): + """Delete the ACLs (remove any rights) set for who on mailbox. + + (typ, [data]) = .deleteacl(mailbox, who) + """ + return self._simple_command('DELETEACL', mailbox, who) def expunge(self): """Permanently remove deleted items from selected mailbox. @@ -518,6 +526,13 @@ class IMAP4: typ, dat = self._simple_command(name, directory, pattern) return self._untagged_response(typ, dat, name) + def myrights(self, mailbox): + """Show my ACLs for a mailbox (i.e. the rights that I have on mailbox). + + (typ, [data]) = .myrights(mailbox) + """ + typ,dat = self._simple_command('MYRIGHTS', mailbox) + return self._untagged_response(typ, dat, 'MYRIGHTS') def namespace(self): """ Returns IMAP namespaces ala rfc2342 diff --git a/Misc/ACKS b/Misc/ACKS index 071f86e..2a2013e 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -328,6 +328,7 @@ Holger Krekel Hannu Krosing Andrew Kuchling Vladimir Kushnir +Arnaud Mazin Cameron Laird Tino Lange Andrew Langmead diff --git a/Misc/NEWS b/Misc/NEWS index e48309c..a7b0f1d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -44,6 +44,8 @@ Extension modules Library ------- +- imaplib has two new methods: deleteacl and myrights. + - nntplib has two new methods: description and descriptions. They use a more RFC-compliant way of getting a newsgroup description. -- cgit v0.12