also already in fully decoded formcould be in any unicode scheme""quoted '\noriginal message\nfor hdr in ('from''to''subject''date')rawhdr message get(hdr'?'if hdr not in ('from''to')dechdr self decodeheader(rawhdrfull value elsedechdr self decodeaddrheader(rawhdrname parts only quoted +'% % \ (hdrdechdrquoted +'\nmaintext quoted '\nquoted replace('\ ''\ 'return quoted #######################subclass requirements #######################def getmessages(selfmsgnumsafter)after(used by view,save,reply,fwd redef if cachethread test plus okaytoquit?any unique actions def getmessage(selfmsgnum)assert false def headersmaps(self)assert false def mailsize(selfmsgnum)assert false def dodelete(self)assert false used by manyfull mail text fillindexhdr mappings list fillindexsize of msgnum ondeletemaildelete button ##############################################################################main window when viewing messages in local save file (or sent-mail file##############################################################################class pymailfile(pymailcommon)""customize pymailcommon for viewing saved-mail file offlinemixed with tktoplevelor frameadds main mail listboxmaps loadfetchdelete actions to local text file storagefile opens and deletes here run in threads for large filessave and send not threadedbecause only append to filesave is disabled if source or target file busy with load/deletesave disables loaddeletesave just because it is not run in thread (blocks gui)tbdmay need thread and / file locks if saves ever do run in threadssaves could disable other threads with openfilebusybut file may not be open in guifile locks not sufficientbecause gui updated tootbdappends to sent-mail file may require / locksas isuser gets error pop up if sent during load/del mail save files are now unicode textencoded per an encoding name setting in the mailconfig modulethis may not support worst case scenarios of unusual or mixed encodingsbut most full mail pymailgui implementation