MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
From: [email protected]
To: [email protected]
Subject: Already got one...
Date: Fri, 04 Jun 2010 06:30:26 −0000
X-Mailer: PyMailGUI 3.0 (Python)
> -----Origin
Send exit
You can also double-click on the PyMailGui.py filename in your file explorer GUI and
monitor the popped-up DOS console box on Windows. Console messages are mostly
intended for debugging, but they can be used to help understand the system’s operation
as well.
For more details on using PyMailGUI, see its help display (press the help bar at the top
of its main server list windows), or read the help string in the module PyMailGui
Help.py, described in the next section.
PyMailGUI Implementation
Last but not least, we get to the code. PyMailGUI consists of the new modules listed
near the start of this chapter, along with a handful of peripheral files described there.
The source code for these modules is listed in this section. Before we get started, here
are two quick reminders to help you study:
Code reuse
Besides the code here, PyMailGUI also gets a lot of mileage out of reusing modules
we wrote earlier and won’t repeat here: mailtools for mail loads, composition,
parsing, and delete operations; threadtools for managing server and local file ac-
cess threads; the GUI section’s TextEditor for displaying and editing mail message
text; and so on. See the example numbers list earlier in this chapter.
In addition, standard Python modules and packages such as poplib, smtplib, and
email hide most of the details of pushing bytes around the Net and extracting and
building message components. As usual, the tkinter standard library module also
implements GUI components in a portable fashion.
Code structure
As mentioned earlier, PyMailGUI applies code factoring and OOP to leverage code
reuse. For instance, list view windows are implemented as a common superclass
that codes most actions, along with one subclass for the server inbox list window
and one for local save-file list windows. The subclasses customize the common
superclass for their specific mail media.
This design reflects the operation of the GUI itself—server list windows load mail
over POP, and save-file list windows load from local files. The basic operation of
1062 | Chapter 14: The PyMailGUI Client