summaryrefslogtreecommitdiffstats
path: root/Lib/imaplib.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-11-10 06:44:44 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-11-10 06:44:44 (GMT)
commitd8921379e9ce1b4133ba54feab9ea0b3d641c94d (patch)
tree8d3c0aff39e22e1763372c3462d04a6533daf8b6 /Lib/imaplib.py
parent49ee14dac5da2249f0f55f00190a9b9f01d23642 (diff)
downloadcpython-d8921379e9ce1b4133ba54feab9ea0b3d641c94d.zip
cpython-d8921379e9ce1b4133ba54feab9ea0b3d641c94d.tar.gz
cpython-d8921379e9ce1b4133ba54feab9ea0b3d641c94d.tar.bz2
Patch #798297: Add IMAP THREAD command.
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r--Lib/imaplib.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index d9166e0..8004982 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -69,6 +69,7 @@ Commands = {
'STATUS': ('AUTH', 'SELECTED'),
'STORE': ('SELECTED',),
'SUBSCRIBE': ('AUTH', 'SELECTED'),
+ 'THREAD': ('SELECTED',),
'UID': ('SELECTED',),
'UNSUBSCRIBE': ('AUTH', 'SELECTED'),
}
@@ -679,6 +680,16 @@ class IMAP4:
return self._simple_command('SUBSCRIBE', mailbox)
+ def thread(self, threading_algorithm, charset, *search_criteria):
+ """IMAPrev1 extension THREAD command.
+
+ (type, [data]) = <instance>.thread(threading_alogrithm, charset, search_criteria, ...)
+ """
+ name = 'THREAD'
+ typ, dat = self._simple_command(name, threading_algorithm, charset, *search_criteria)
+ return self._untagged_response(typ, dat, name)
+
+
def uid(self, command, *args):
"""Execute "command arg ..." with messages identified by UID,
rather than message number.