[Python-bugs-list] Re: Bug(?) in imaplib.py - SEARCH function (PR#339)
fdrake@acm.org
fdrake@acm.org
Thu, 25 May 2000 23:42:11 -0400 (EDT)
[CC to Piers since this is his module...]
On Thu, 25 May 2000 Lucas.DeJonge@awtpl.com.au wrote:
> It is not at all clear in the doco though. Perhaps this could be put in the example?
>
> >>> Guido van Rossum <bugs-py@python.org> 26/05/00 0:16:26 >>>
> According to Piers Lauder, you should do either:
> fred.search(None, 'FROM', '"LDJ"')
> or
> fred.search(None, '(FROM "LDJ")')
>
> (the doublequotes can be omitted in both examples.)
How about this for a revised description of the search() method:
\begin{methoddesc}{search}{charset, criterium\optional{, ...}}
Search mailbox for matching messages. Returned data contains a space
separated list of matching message numbers. \var{charset} may be
\code{None}, in which case no \samp{CHARSET} will be specified in the
request to the server. The IMAP protocol requires that at least one
criterium be specified; an exception will be raised when the server
returns an error.
Example:
\begin{verbatim}
# M is a connected IMAP4 instance...
msgnums = M.search(None, 'FROM', '"LDJ"')
# or:
msgnums = M.search(None, '(FROM "LDJ")')
\end{verbatim}
\end{methoddesc}
-Fred
--
Fred L. Drake, Jr. <fdrake at acm.org>