Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 363d67c

Browse files
committed
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.
1 parent d5f173b commit 363d67c

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

Doc/lib/libimaplib.tex

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,21 @@ \section{\module{imaplib} ---
6565
\end{funcdesc}
6666

6767

68-
\subsection{IMAP4 Objects}
69-
\label{imap4-objects}
68+
Note that IMAP4 message numbers change as the mailbox changes, so it
69+
is highly advisable to use UIDs instead, with the UID command.
70+
71+
At the end of the module, there is a test section that contains a more
72+
extensive example of usage.
73+
74+
\begin{seealso}
75+
\seetext{Documents describing the protocol, and sources and binaries
76+
for servers implementing it, can all be found at the University of
77+
Washington's \emph{IMAP Information Center}
78+
(\url{http://www.cac.washington.edu/imap/}).}
79+
\end{seealso}
80+
81+
82+
\subsection{IMAP4 Objects \label{imap4-objects}}
7083

7184
All IMAP4rev1 commands are represented by methods of the same name,
7285
either upper-case or lower-case.
@@ -212,33 +225,20 @@ \subsection{IMAP4 Objects}
212225
\end{memberdesc}
213226

214227

215-
\subsection{IMAP4 Example}
216-
\label{imap4-example}
228+
\subsection{IMAP4 Example \label{imap4-example}}
217229

218230
Here is a minimal example (without error checking) that opens a
219231
mailbox and retrieves and prints all messages:
220232

221233
\begin{verbatim}
222234
import getpass, imaplib, string
235+
223236
M = imaplib.IMAP4()
224-
M.LOGIN(getpass.getuser(), getpass.getpass())
225-
M.SELECT()
226-
typ, data = M.SEARCH(None, 'ALL')
237+
M.login(getpass.getuser(), getpass.getpass())
238+
M.select()
239+
typ, data = M.search(None, 'ALL')
227240
for num in string.split(data[0]):
228-
typ, data = M.FETCH(num, '(RFC822)')
241+
typ, data = M.fetch(num, '(RFC822)')
229242
print 'Message %s\n%s\n' % (num, data[0][1])
230-
M.LOGOUT()
243+
M.logout()
231244
\end{verbatim}
232-
233-
Note that IMAP4 message numbers change as the mailbox changes, so it
234-
is highly advisable to use UIDs instead, with the UID command.
235-
236-
At the end of the module, there is a test section that contains a more
237-
extensive example of usage.
238-
239-
\begin{seealso}
240-
\seetext{Documents describing the protocol, and sources and binaries
241-
for servers implementing it, can all be found at the University of
242-
Washington's \emph{IMAP Information Center}
243-
(\url{http://www.cac.washington.edu/imap/}).}
244-
\end{seealso}

0 commit comments

Comments
 (0)