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

(yzsuai) #1

source-code viewing (we saw the latter in Figure 14-3). For mail view components,
PyMailGUI customizes PyEdit text fonts and colors per its own configuration module;
for pop ups, user preferences in a local textConfig module are applied.


To display email, PyMailGUI inserts its text into an attached TextEditor object; to
compose email, PyMailGUI presents a TextEditor and later fetches all its text to ship
over the Net. Besides the obvious simplification here, this code reuse makes it easy to
pick up improvements and fixes—any changes in the TextEditor object are automati-
cally inherited by PyMailGUI, PyView, and PyEdit.


In the third edition’s version, for instance, PyMailGUI supports edit undo and redo,
just because PyEdit had gained that feature. And in this fourth edition, all PyEdit im-
porters also inherit its new Grep file search, as well as its new support for viewing and
editing text of arbitrary Unicode encodings—especially useful for text parts in emails
of arbitrary origin like those displayed here (see Chapter 11 for more about PyEdit’s
evolution).


Loading Mail


Next, let’s go back to the PyMailGUI main server list window, and click the Load button
to retrieve incoming email over the POP protocol. PyMailGUI’s load function gets


Figure 14-5. PyMailGUI view window


A PyMailGUI Demo| 1025
Free download pdf