twisted.protocols.imap4.html [plain text]
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>twisted.protocols.imap4</title>
<link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
<tr valign="center">
<th class="navbar"> <a class="navbar" href="twisted.html">Home</a> </th>
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center">
<p class="nomargin">
<a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted 1.3.0rc1</a>
</p></th></tr></table>
</th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<font size="-1"><b class="breadcrumbs">
<a href="twisted.html">Package twisted</a> ::
<a href="twisted.protocols.html">Package protocols</a> ::
Module imap4
</b></font></br>
</td>
<td><table cellpadding="0" cellspacing="0">
<tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a> | <a href="twisted.protocols.imap4.html" target="_top">no frames</a>]</font></td></tr>
</table></td>
</tr></table>
<!-- =========== START OF MODULE DESCRIPTION =========== -->
<h2 class="module">Module twisted.protocols.imap4</h2>
<pre class="literalblock">
An IMAP4 protocol implementation
API Stability: Semi-stable
@author: U{Jp Calderone<mailto:exarkun@twistedmatrix.com>}
To do:
Suspend idle timeout while server is processing
Use an async message parser instead of buffering in memory
Figure out a way to not queue multi-message client requests (Flow? A simple callback?)
Clarify some API docs (Query, etc)
Make APPEND recognize (again) non-existent mailboxes before accepting the literal
</pre>
<hr/>
<!-- =========== START OF CLASSES =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
<th colspan="2">Classes</th></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4._FetchParser.html"><code>_FetchParser</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.Command.html"><code>Command</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.CramMD5ClientAuthenticator.html"><code>CramMD5ClientAuthenticator</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.DontQuoteMe.html"><code>DontQuoteMe</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.FileProducer.html"><code>FileProducer</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IAccount.html"><code>IAccount</code></a></b></td>
<td>Interface for Account classes</td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IClientAuthentication.html"><code>IClientAuthentication</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.ICloseableMailbox.html"><code>ICloseableMailbox</code></a></b></td>
<td>A supplementary interface for mailboxes which require cleanup on
close.</td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMailbox.html"><code>IMailbox</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMailboxInfo.html"><code>IMailboxInfo</code></a></b></td>
<td>Interface specifying only the methods required for
<code>listMailboxes</code>.</td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMailboxListener.html"><code>IMailboxListener</code></a></b></td>
<td>Interface for objects interested in mailbox events</td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMAP4Client.html"><code>IMAP4Client</code></a></b></td>
<td>IMAP4 client protocol implementation</td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMAP4Server.html"><code>IMAP4Server</code></a></b></td>
<td>Protocol implementation for an IMAP4rev1 server.</td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMessage.html"><code>IMessage</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMessageCopier.html"><code>IMessageCopier</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMessageFile.html"><code>IMessageFile</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMessagePart.html"><code>IMessagePart</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.INamespacePresenter.html"><code>INamespacePresenter</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.ISearchableMailbox.html"><code>ISearchableMailbox</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.LiteralFile.html"><code>LiteralFile</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.LiteralString.html"><code>LiteralString</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.LOGINAuthenticator.html"><code>LOGINAuthenticator</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.LOGINCredentials.html"><code>LOGINCredentials</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.MemoryAccount.html"><code>MemoryAccount</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.MessageProducer.html"><code>MessageProducer</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.MessageSet.html"><code>MessageSet</code></a></b></td>
<td>Essentially an infinite bitfield, with some extra features.</td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.PLAINAuthenticator.html"><code>PLAINAuthenticator</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.PLAINCredentials.html"><code>PLAINCredentials</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.StreamReader.html"><code>StreamReader</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.StreamWriter.html"><code>StreamWriter</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.WriteBuffer.html"><code>WriteBuffer</code></a></b></td>
<td>Buffer up a bunch of writes before sending them all to a transport at
once.</td></tr>
</table><br />
<!-- =========== START OF EXCEPTIONS =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
<th colspan="2">Exceptions</th></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IllegalClientResponse.html"><code>IllegalClientResponse</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IllegalIdentifierError.html"><code>IllegalIdentifierError</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IllegalMailboxEncoding.html"><code>IllegalMailboxEncoding</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IllegalOperation.html"><code>IllegalOperation</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IllegalQueryError.html"><code>IllegalQueryError</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IllegalServerResponse.html"><code>IllegalServerResponse</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.IMAP4Exception.html"><code>IMAP4Exception</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.MailboxCollision.html"><code>MailboxCollision</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.MailboxException.html"><code>MailboxException</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.MismatchedNesting.html"><code>MismatchedNesting</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.MismatchedQuoting.html"><code>MismatchedQuoting</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.NegativeResponse.html"><code>NegativeResponse</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.NoSuchMailbox.html"><code>NoSuchMailbox</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.NoSupportedAuthentication.html"><code>NoSupportedAuthentication</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.ReadOnlyMailbox.html"><code>ReadOnlyMailbox</code></a></b></td>
<td> </td></tr>
<tr><td width="15%">
<b><a href="twisted.protocols.imap4.UnhandledResponse.html"><code>UnhandledResponse</code></a></b></td>
<td> </td></tr>
</table><br />
<!-- =========== START OF FUNCTION SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
<th colspan="2">Function Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="_formatHeaders"></a><span class="summary-sig"><span class="summary-sig-name">_formatHeaders</span>(<span class=summary-sig-arg>headers</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="_literal"></a><span class="summary-sig"><span class="summary-sig-name">_literal</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="_needsLiteral"></a><span class="summary-sig"><span class="summary-sig-name">_needsLiteral</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="_needsQuote"></a><span class="summary-sig"><span class="summary-sig-name">_needsQuote</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="_quote"></a><span class="summary-sig"><span class="summary-sig-name">_quote</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> <code>str</code>
</font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.imap4.html#collapseNestedLists" class="summary-sig-name"><code>collapseNestedLists</code></a>(<span class=summary-sig-arg>items</span>)</span></code>
<br />
Turn a nested list structure into an s-exp-like string.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> <code>list</code> of <code>str</code> and
<code>list</code>
</font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.imap4.html#collapseStrings" class="summary-sig-name"><code>collapseStrings</code></a>(<span class=summary-sig-arg>results</span>)</span></code>
<br />
Turns a list of length-one strings and lists into a list of longer
strings and lists.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="decoder"></a><span class="summary-sig"><span class="summary-sig-name">decoder</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="encoder"></a><span class="summary-sig"><span class="summary-sig-name">encoder</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="getBodyStructure"></a><span class="summary-sig"><span class="summary-sig-name">getBodyStructure</span>(<span class=summary-sig-arg>msg</span>,
<span class=summary-sig-arg>extended</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="getEnvelope"></a><span class="summary-sig"><span class="summary-sig-name">getEnvelope</span>(<span class=summary-sig-arg>msg</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="getLineCount"></a><span class="summary-sig"><span class="summary-sig-name">getLineCount</span>(<span class=summary-sig-arg>msg</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="imap4_utf_7"></a><span class="summary-sig"><span class="summary-sig-name">imap4_utf_7</span>(<span class=summary-sig-arg>name</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> <code>Deferred</code>
</font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.imap4.html#iterateInReactor" class="summary-sig-name"><code>iterateInReactor</code></a>(<span class=summary-sig-arg>i</span>)</span></code>
<br />
Consume an interator at most a single iteration per reactor
iteration.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="modified_base64"></a><span class="summary-sig"><span class="summary-sig-name">modified_base64</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="modified_unbase64"></a><span class="summary-sig"><span class="summary-sig-name">modified_unbase64</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.imap4.html#Not" class="summary-sig-name"><code>Not</code></a>(<span class=summary-sig-arg>query</span>)</span></code>
<br />
The negation of a query</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.imap4.html#Or" class="summary-sig-name"><code>Or</code></a>(<span class="summary-sig-vararg">*args</span>)</span></code>
<br />
The disjunction of two or more queries</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="parseAddr"></a><span class="summary-sig"><span class="summary-sig-name">parseAddr</span>(<span class=summary-sig-arg>addr</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="parseIdList"></a><span class="summary-sig"><span class="summary-sig-name">parseIdList</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> <code>list</code> of <code>str</code> and
<code>list</code>
</font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.imap4.html#parseNestedParens" class="summary-sig-name"><code>parseNestedParens</code></a>(<span class=summary-sig-arg>s</span>,
<span class=summary-sig-arg>handleLiteral</span>)</span></code>
<br />
Parse an s-exp-like string into a more useful data structure.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="parseTime"></a><span class="summary-sig"><span class="summary-sig-name">parseTime</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.imap4.html#Query" class="summary-sig-name"><code>Query</code></a>(<span class=summary-sig-arg>sorted</span>,
<span class="summary-sig-kwarg">**kwarg</span>)</span></code>
<br />
Create a query string
Among the accepted keywords are:
all : If set to a true value, search all messages in the
current mailbox
answered : If set to a true value, search messages flagged with
\Answered
bcc : A substring to search the BCC header field for
before : Search messages with an internal date before this
value.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="splitOn"></a><span class="summary-sig"><span class="summary-sig-name">splitOn</span>(<span class=summary-sig-arg>sequence</span>,
<span class=summary-sig-arg>predicate</span>,
<span class=summary-sig-arg>transformers</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> <code>list</code> of <code>str</code>
</font></td>
<td><code><span class="summary-sig"><a href="twisted.protocols.imap4.html#splitQuoted" class="summary-sig-name"><code>splitQuoted</code></a>(<span class=summary-sig-arg>s</span>)</span></code>
<br />
Split a string into whitespace delimited tokens</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="statusRequestHelper"></a><span class="summary-sig"><span class="summary-sig-name">statusRequestHelper</span>(<span class=summary-sig-arg>mbox</span>,
<span class=summary-sig-arg>names</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="subparts"></a><span class="summary-sig"><span class="summary-sig-name">subparts</span>(<span class=summary-sig-arg>m</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><a name="wildcardToRegexp"></a><span class="summary-sig"><span class="summary-sig-name">wildcardToRegexp</span>(<span class=summary-sig-arg>wildcard</span>,
<span class=summary-sig-arg>delim</span>)</span></code>
</td></tr>
</table><br />
<!-- =========== START OF VARIABLE SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
<th colspan="2">Variable Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>str</code></font></td>
<td><b><a href="twisted.protocols.imap4.html#_ATOM_SPECIALS"><code>_ATOM_SPECIALS</code></a></b> = <span title="'(){ %*"'"><code><span class="variable-quote">'</span>(){ %*"<span class="variable-quote">'</span> </code>
</span></td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>tuple</code></font></td>
<td><b><a href="twisted.protocols.imap4.html#_NO_QUOTES"><code>_NO_QUOTES</code></a></b> = <span title="('LARGER', 'SMALLER', 'UID')"><code>('LARGER', 'SMALLER', 'UID') </code>
</span></td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>tuple</code></font></td>
<td><b><a href="twisted.protocols.imap4.html#_SIMPLE_BOOL"><code>_SIMPLE_BOOL</code></a></b> = <span title="('ALL', 'ANSWERED', 'DELETED', 'DRAFT', 'FLAGGED', 'NEW', 'OLD', 'RECENT', 'SEEN', 'UNANSWERED', 'UNDELETED', 'UNDRAFT', 'UNFLAGGED', 'UNSEEN')"><code>('ALL', 'ANSWERED', 'DELETED', 'DRAFT', '<span class="variable-ellipsis">...</span></code>
</span></td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>dict</code></font></td>
<td><b><a href="twisted.protocols.imap4.html#_statusRequestDict"><code>_statusRequestDict</code></a></b> = <span title="{'UIDNEXT': 'getUIDNext', 'UIDVALIDITY': 'getUIDValidity', 'MESSAGES': 'getMessageCount', 'UNSEEN': 'getUnseenCount', 'RECENT': 'getRecentCount'}"><code>{'UIDNEXT': 'getUIDNext', 'UIDVALID<span class="variable-ellipsis">...</span></code>
</span></td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>xrange</code></font></td>
<td><b><a href="twisted.protocols.imap4.html#infrangeobject"><code>infrangeobject</code></a></b> = <span title="xrange(2147483647)"><code>xrange(2147483647) </code>
</span></td></tr>
</table><br />
<!-- =========== START OF FUNCTION DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
<th colspan="2">Function Details</th></tr>
</table>
<a name="collapseNestedLists"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">collapseNestedLists</span>(<span class=sig-arg>items</span>)</span>
</h3>
<p>Turn a nested list structure into an s-exp-like string.</p>
<p>Strings in <code>items</code> will be sent as literals if they
contain CR or LF, otherwise they will be quoted. References to None in
<code>items</code> will be translated to the atom NIL. Objects with a
'read' attribute will have it called on them with no arguments and the
returned string will be inserted into the output as a literal. Integers
will be converted to strings and inserted into the output unquoted.
Instances of <code>DontQuoteMe</code> will be converted to strings and
inserted into the output unquoted.</p>
This function used to be much nicer, and only quote things that
really needed to be quoted (and <code>DontQuoteMe</code> did not
exist), however, many broken IMAP4 clients were unable to deal with
this level of sophistication, forcing the current behavior to be
adopted for practical reasons.
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>items</b></code>
<br /><i>
(type=Any iterable)</i>
</dd>
</dl>
<dl><dt><b>Returns:</b></dt>
<dd>
<code>str</code>
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="collapseStrings"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">collapseStrings</span>(<span class=sig-arg>results</span>)</span>
</h3>
<p>Turns a list of length-one strings and lists into a list of longer
strings and lists. For example,</p>
['a', 'b', ['c', 'd']] is returned as ['ab', ['cd']]
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>results</b></code> -
The list to be collapsed
<br /><i>
(type=<code>list</code> of <code>str</code> and
<code>list</code>)</i>
</dd>
</dl>
<dl><dt><b>Returns:</b></dt>
<dd>
A new list which is the collapsed form of
<code>results</code>
<br /><i>
(type=<code>list</code> of <code>str</code> and
<code>list</code>)</i>
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="iterateInReactor"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">iterateInReactor</span>(<span class=sig-arg>i</span>)</span>
</h3>
<p>Consume an interator at most a single iteration per reactor
iteration.</p>
If the iterator produces a Deferred, the next iteration will not
occur until the Deferred fires, otherwise the next iteration will be
taken in the next reactor iteration.
<dl><dt></dt><dd>
<dl><dt><b>Returns:</b></dt>
<dd>
A deferred which fires (with None) when the iterator is
exhausted or whose errback is called if there is an
exception.
<br /><i>
(type=<code>Deferred</code>)</i>
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="Not"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">Not</span>(<span class=sig-arg>query</span>)</span>
</h3>
The negation of a query
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="Or"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">Or</span>(<span class="sig-vararg">*args</span>)</span>
</h3>
The disjunction of two or more queries
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="parseNestedParens"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">parseNestedParens</span>(<span class=sig-arg>s</span>,
<span class=sig-arg>handleLiteral</span>=<span class=sig-default>1</span>)</span>
</h3>
Parse an s-exp-like string into a more useful data structure.
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>s</b></code> -
The s-exp-like string to parse
<br /><i>
(type=<code>str</code>)</i>
</dd>
</dl>
<dl><dt><b>Returns:</b></dt>
<dd>
A list containing the tokens present in the input.
<br /><i>
(type=<code>list</code> of <code>str</code> and
<code>list</code>)</i>
</dd>
</dl>
<dl><dt><b>Raises:</b></dt>
<dd><code><b>MismatchedNesting</b></code> -
Raised if the number or placement of opening or closing
parenthesis is invalid.
</dl>
</dd></dl>
</td></tr></table>
<a name="Query"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">Query</span>(<span class=sig-arg>sorted</span>=<span class=sig-default>0</span>,
<span class="sig-kwarg">**kwarg</span>)</span>
</h3>
<pre class="literalblock">
Create a query string
Among the accepted keywords are:
all : If set to a true value, search all messages in the
current mailbox
answered : If set to a true value, search messages flagged with
\Answered
bcc : A substring to search the BCC header field for
before : Search messages with an internal date before this
value. The given date should be a string in the format
of 'DD-Mon-YYYY'. For example, '03-Mar-2003'.
body : A substring to search the body of the messages for
cc : A substring to search the CC header field for
deleted : If set to a true value, search messages flagged with
\Deleted
draft : If set to a true value, search messages flagged with
\Draft
flagged : If set to a true value, search messages flagged with
\Flagged
from : A substring to search the From header field for
header : A two-tuple of a header name and substring to search
for in that header
keyword : Search for messages with the given keyword set
larger : Search for messages larger than this number of octets
messages : Search only the given message sequence set.
new : If set to a true value, search messages flagged with
\Recent but not \Seen
old : If set to a true value, search messages not flagged with
\Recent
on : Search messages with an internal date which is on this
date. The given date should be a string in the format
of 'DD-Mon-YYYY'. For example, '03-Mar-2003'.
recent : If set to a true value, search for messages flagged with
\Recent
seen : If set to a true value, search for messages flagged with
\Seen
sentbefore : Search for messages with an RFC822 'Date' header before
this date. The given date should be a string in the format
of 'DD-Mon-YYYY'. For example, '03-Mar-2003'.
senton : Search for messages with an RFC822 'Date' header which is
on this date The given date should be a string in the format
of 'DD-Mon-YYYY'. For example, '03-Mar-2003'.
sentsince : Search for messages with an RFC822 'Date' header which is
after this date. The given date should be a string in the format
of 'DD-Mon-YYYY'. For example, '03-Mar-2003'.
since : Search for messages with an internal date that is after
this date.. The given date should be a string in the format
of 'DD-Mon-YYYY'. For example, '03-Mar-2003'.
smaller : Search for messages smaller than this number of octets
subject : A substring to search the 'subject' header for
text : A substring to search the entire message for
to : A substring to search the 'to' header for
uid : Search only the messages in the given message set
unanswered : If set to a true value, search for messages not
flagged with \Answered
undeleted : If set to a true value, search for messages not
flagged with \Deleted
undraft : If set to a true value, search for messages not
flagged with \Draft
unflagged : If set to a true value, search for messages not
flagged with \Flagged
unkeyword : Search for messages without the given keyword set
unseen : If set to a true value, search for messages not
flagged with \Seen
@type sorted: C{bool}
@param sorted: If true, the output will be sorted, alphabetically.
The standard does not require it, but it makes testing this function
easier. The default is zero, and this should be acceptable for any
application.
@rtype: C{str}
@return: The formatted query string
</pre>
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="splitQuoted"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">splitQuoted</span>(<span class=sig-arg>s</span>)</span>
</h3>
<p>Split a string into whitespace delimited tokens</p>
Tokens that would otherwise be separated but are surrounded by
" remain as a single token. Any token that is not quoted and is
equal to "NIL" is tokenized as <code>None</code>.
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>s</b></code> -
The string to be split
<br /><i>
(type=<code>str</code>)</i>
</dd>
</dl>
<dl><dt><b>Returns:</b></dt>
<dd>
A list of the resulting tokens
<br /><i>
(type=<code>list</code> of <code>str</code>)</i>
</dd>
</dl>
<dl><dt><b>Raises:</b></dt>
<dd><code><b>MismatchedQuoting</b></code> -
Raised if an odd number of quotes are present
</dl>
</dd></dl>
</td></tr></table>
<br />
<!-- =========== START OF VARIABLE DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
<th colspan="2">Variable Details</th></tr>
</table>
<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
<a name="_ATOM_SPECIALS"></a>
<h3>_ATOM_SPECIALS</h3>
<dl>
<dt></dt>
<dd>
<dl>
<dt><b>Type:</b></dt>
<dd>
<code>str</code>
</dd>
<span title="'(){ %*"'"> <dt><b>Value:</b></dt>
<dd><table><tr><td>
<pre class="variable">
<span class="variable-quote">'</span>(){ %*"<span class="variable-quote">'</span> </pre>
</td></tr></table></dd>
</span> </dl>
</dd>
</dl></td></tr></table>
<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
<a name="_NO_QUOTES"></a>
<h3>_NO_QUOTES</h3>
<dl>
<dt></dt>
<dd>
<dl>
<dt><b>Type:</b></dt>
<dd>
<code>tuple</code>
</dd>
<span title="('LARGER', 'SMALLER', 'UID')"> <dt><b>Value:</b></dt>
<dd><table><tr><td>
<pre class="variable">
('LARGER', 'SMALLER', 'UID') </pre>
</td></tr></table></dd>
</span> </dl>
</dd>
</dl></td></tr></table>
<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
<a name="_SIMPLE_BOOL"></a>
<h3>_SIMPLE_BOOL</h3>
<dl>
<dt></dt>
<dd>
<dl>
<dt><b>Type:</b></dt>
<dd>
<code>tuple</code>
</dd>
<span title="('ALL', 'ANSWERED', 'DELETED', 'DRAFT', 'FLAGGED', 'NEW', 'OLD', 'RECENT', 'SEEN', 'UNANSWERED', 'UNDELETED', 'UNDRAFT', 'UNFLAGGED', 'UNSEEN')"> <dt><b>Value:</b></dt>
<dd><table><tr><td>
<pre class="variable">
('ALL',
'ANSWERED',
'DELETED',
'DRAFT',
'FLAGGED',
'NEW',
'OLD',
'RECENT',
<span class="variable-ellipsis">...</span> </pre>
</td></tr></table></dd>
</span> </dl>
</dd>
</dl></td></tr></table>
<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
<a name="_statusRequestDict"></a>
<h3>_statusRequestDict</h3>
<dl>
<dt></dt>
<dd>
<dl>
<dt><b>Type:</b></dt>
<dd>
<code>dict</code>
</dd>
<span title="{'UIDNEXT': 'getUIDNext', 'UIDVALIDITY': 'getUIDValidity', 'MESSAGES': 'getMessageCount', 'UNSEEN': 'getUnseenCount', 'RECENT': 'getRecentCount'}"> <dt><b>Value:</b></dt>
<dd><table><tr><td>
<pre class="variable">
{'MESSAGES': 'getMessageCount',
'RECENT': 'getRecentCount',
'UIDNEXT': 'getUIDNext',
'UIDVALIDITY': 'getUIDValidity',
'UNSEEN': 'getUnseenCount'} </pre>
</td></tr></table></dd>
</span> </dl>
</dd>
</dl></td></tr></table>
<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
<a name="infrangeobject"></a>
<h3>infrangeobject</h3>
<dl>
<dt></dt>
<dd>
<dl>
<dt><b>Type:</b></dt>
<dd>
<code>xrange</code>
</dd>
<span title="xrange(2147483647)"> <dt><b>Value:</b></dt>
<dd><table><tr><td>
<pre class="variable">
xrange(2147483647) </pre>
</td></tr></table></dd>
</span> </dl>
</dd>
</dl></td></tr></table>
<br />
<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
<tr valign="center">
<th class="navbar"> <a class="navbar" href="twisted.html">Home</a> </th>
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center">
<p class="nomargin">
<a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted 1.3.0rc1</a>
</p></th></tr></table>
</th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left"><font size="-2">Generated by Epydoc 2.0 on Sat May 15 20:08:54 2004</font></td>
<td align="right"><a href="http://epydoc.sourceforge.net"
><font size="-2">http://epydoc.sf.net</font></a></td>
</tr>
</table>
</body>
</html>