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

(yzsuai) #1

a cache that keeps track of mail already loaded
wraplines.py
utility for wrapping long lines of messages
html2text.py
rudimentary HTML parser for extracting plain text
mailconfig.py
user configuration parameters: server names, fonts, etc.


==Program-specific modules defined here:==


SharedNames.py
objects shared between window classes and main file
ViewWindows.py
implementation of view, write, reply, forward windows
ListWindows.py
implementation of mail-server and local-file list windows
PyMailGuiHelp.py (see also PyMailGuiHelp.html)
user-visible help text, opened by main window bar
PyMailGui.py
main, top-level file (run this), with main window types
##################################################################################
"""


import mailconfig, sys
from SharedNames import appname, windows
from ListWindows import PyMailServer, PyMailFile


###############################################################################


top-level window classes



View, Write, Reply, Forward, Help, BusyBox all inherit from PopupWindow


directly: only usage; askpassword calls PopupWindow and attaches; the


order matters here!--PyMail classes redef some method defaults in the


Window classes, like destroy and okayToExit: must be leftmost; to use


PyMailFileWindow standalone, imitate logic in PyMailCommon.onOpenMailFile;


###############################################################################


uses icon file in cwd or default in tools dir


srvrname = mailconfig.popservername or 'Server'


class PyMailServerWindow(PyMailServer, windows.MainWindow):
"a Tk, with extra protocol and mixed-in methods"
def init(self):
windows.MainWindow.init(self, appname, srvrname)
PyMailServer.init(self)


class PyMailServerPopup(PyMailServer, windows.PopupWindow):
"a Toplevel, with extra protocol and mixed-in methods"
def init(self):
windows.PopupWindow.init(self, appname, srvrnane)
PyMailServer.init(self)


class PyMailServerComponent(PyMailServer, windows.ComponentWindow):
"a Frame, with extra protocol and mixed-in methods"


PyMailGUI Implementation| 1065
Free download pdf