summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libimaplib.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-07-07 13:42:56 (GMT)
committerFred Drake <fdrake@acm.org>1999-07-07 13:42:56 (GMT)
commit363d67c2e62801cfaca7faec769a18acc4af49c2 (patch)
tree2e4f59b9bda75b0adfdf4dbc592a6010e90ff190 /Doc/lib/libimaplib.tex
parentd5f173bf1f215ce156805545ff20e0d764162e89 (diff)
downloadcpython-363d67c2e62801cfaca7faec769a18acc4af49c2.zip
cpython-363d67c2e62801cfaca7faec769a18acc4af49c2.tar.gz
cpython-363d67c2e62801cfaca7faec769a18acc4af49c2.tar.bz2
Move some misc. comments from the example section to the main section.
Use the lowercase versions of the method names in the example, since that's what's documented (Greg Stein's suggestion). Add a blank line after the import line for clarity.
Diffstat (limited to 'Doc/lib/libimaplib.tex')
-rw-r--r--Doc/lib/libimaplib.tex44
1 files changed, 22 insertions, 22 deletions
diff --git a/Doc/lib/libimaplib.tex b/Doc/lib/libimaplib.tex
index 294963f..c96eb1f 100644
--- a/Doc/lib/libimaplib.tex
+++ b/Doc/lib/libimaplib.tex
@@ -65,8 +65,21 @@ The following utility functions are defined:
\end{funcdesc}
-\subsection{IMAP4 Objects}
-\label{imap4-objects}
+Note that IMAP4 message numbers change as the mailbox changes, so it
+is highly advisable to use UIDs instead, with the UID command.
+
+At the end of the module, there is a test section that contains a more
+extensive example of usage.
+
+\begin{seealso}
+\seetext{Documents describing the protocol, and sources and binaries
+for servers implementing it, can all be found at the University of
+Washington's \emph{IMAP Information Center}
+(\url{http://www.cac.washington.edu/imap/}).}
+\end{seealso}
+
+
+\subsection{IMAP4 Objects \label{imap4-objects}}
All IMAP4rev1 commands are represented by methods of the same name,
either upper-case or lower-case.
@@ -212,33 +225,20 @@ three trace each command.
\end{memberdesc}
-\subsection{IMAP4 Example}
-\label{imap4-example}
+\subsection{IMAP4 Example \label{imap4-example}}
Here is a minimal example (without error checking) that opens a
mailbox and retrieves and prints all messages:
\begin{verbatim}
import getpass, imaplib, string
+
M = imaplib.IMAP4()
-M.LOGIN(getpass.getuser(), getpass.getpass())
-M.SELECT()
-typ, data = M.SEARCH(None, 'ALL')
+M.login(getpass.getuser(), getpass.getpass())
+M.select()
+typ, data = M.search(None, 'ALL')
for num in string.split(data[0]):
- typ, data = M.FETCH(num, '(RFC822)')
+ typ, data = M.fetch(num, '(RFC822)')
print 'Message %s\n%s\n' % (num, data[0][1])
-M.LOGOUT()
+M.logout()
\end{verbatim}
-
-Note that IMAP4 message numbers change as the mailbox changes, so it
-is highly advisable to use UIDs instead, with the UID command.
-
-At the end of the module, there is a test section that contains a more
-extensive example of usage.
-
-\begin{seealso}
-\seetext{Documents describing the protocol, and sources and binaries
-for servers implementing it, can all be found at the University of
-Washington's \emph{IMAP Information Center}
-(\url{http://www.cac.washington.edu/imap/}).}
-\end{seealso}