[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版

(yzsuai) #1

commonhtml.listpage
Generates HTML to display a passed-in list of tuples (text, URL, parameter-
dictionary) as a list of hyperlinks in the reply page; parameter values show up as
query parameters at the end of URLs in the response.


The maillist list built here is used to create the body of the next page—a clickable
email message selection list. Each generated hyperlink in the list page references a con-
structed URL that contains enough information for the next script to fetch and display
a particular email message. As we learned in the preceding chapter, this is a simple kind
of state retention between pages and scripts.


If all goes well, the mail selection list page HTML generated by this script is rendered
as in Figure 16-8. If your inbox is as large as some of mine, you’ll probably need to
scroll down to see the end of this page. This page follows the common look-and-feel
for all PyMailCGI pages, thanks to commonhtml.


Figure 16-8. PyMailCGI view selection list page, top


If the script can’t access your email account (e.g., because you typed the wrong pass-
word), its try statement handler instead produces a commonly formatted error page.


Reading POP Email| 1253
Free download pdf