common superclass to avoid redundancy and simplify the code message view windows are similarly factoreda common view window superclass is reused and customized for writereplyand forward view windows to make the code easier to followit is divided into two main modules that reflect the structure of the gui--one for the implementation of list window actions and one for view window actions if you are looking for the implementation of button that appears in mail view or edit windowfor instancesee the view window module and search for method whose name begins with the word on--the convention used for callback handler methods specific button' text can also be located in name/callback tables used to build the windows actions initiated on list windows are coded in the list window module instead in additionthe message cache is split off into an object and module of its ownand potentially reusable tools are coded in importable modules ( line wrapping and utility pop upspymailgui also includes main module that defines startup window classesa simple html to plain-text parsera module that contains the help text as stringthe mailconfig user settings module ( version specific to pymailgui is used here)and small handful of related files the following subsections present each of pymailgui' source code files for you to study as you readrefer back to the demo earlier in this and run the program live to map its behavior back to its code one accounting note up-frontthe only one of pymailgui' new source files not listed in this section is its __init__ py package initialization file this file is mostly empty except for comment string and is unused in the system today it exists only for future expansionin case pymailgui is ever used as package in the future--some of its modules may be useful in other programs as isthoughsame-directory internal imports here are not package-relativeso they assume this system is either run as toplevel program (to import from "or is listed on sys path directly (to use absolute importsin python xa package' directory is not included on sys path automaticallyso future use as package would require changes to internal imports ( moving the main script up one level and using from import module throughoutsee resources such as the book learning python for more on packages and package imports pymailguithe main module example - defines the file run to start pymailgui it implements top-level list windows in the system--combinations of pymailgui' application logic and the window protocol superclasses we wrote earlier in the text the latter of these define window titlesiconsand close behavior the main internalnonuser documentation is also in this moduleas well as commandline logic--the program accepts the names of one or more save-mail files on the pymailgui implementation