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

(yzsuai) #1

addresses in group mail scenarios. Open this version’s mail save file to view this mail’s
behavior live, and see the suggested enhancements later for more ideas.


Deleting Email


So far, we’ve covered every action button on list windows except for Delete and the All
checkbox. The All checkbox simply toggles from selecting all messages at once or de-
selecting all (View, Delete, Reply, Fwd, and Save action buttons apply to all currently
selected messages). PyMailGUI also lets us delete messages from the server perma-
nently, so that we won’t see them the next time we access our inbox.


Delete operations are kicked off the same way as Views and Saves; just press the Delete
button instead. In typical operation, I eventually delete email I’m not interested in, and
save and delete emails that are important. We met Save earlier in this demo.


Like View, Save, and other operations, Delete can be applied to one or more messages.
Deletes happen immediately, and like all server transfers, they are run in a nonblocking
thread but are performed only if you verify the operation in a pop up, such as the one
shown in Figure 14-35. During the delete, a progress dialog like those in Figures 14-8
and 14-9 provide status.


Figure 14-33. PyMailGUI view forwarded mail, raw


A PyMailGUI Demo| 1049
Free download pdf