always verify here showerror(appname'no message selected'elseif askyesno(appname'verify delete % mails?len(msgnums))self dodelete(msgnums#################utility methods #################def selectedmsgs(self)get messages selected in main listbox selections self listbox curselection(return [int( )+ for in selectionstuple of digit strs - convert to intsmake warninglimit def verifyselectedmsgs(self)msgnums self selectedmsgs(if not msgnumsshowerror(appname'no message selected'elsenumselects len(msgnumsif numselects self warninglimitif not askyesno(appname'open % selections?numselects)msgnums [return msgnums def fillindex(selfmaxhdrsize= )""fill all of main listbox from message header mappings decode headers per email/mime/unicode here if encoded caveatlarge chinese characters can break '|alignment""hdrmaps self headersmaps(may be empty showhdrs ('subject''from''date''to'default hdrs to show if hasattr(mailconfig'listheaders')mailconfig customizes showhdrs mailconfig listheaders or showhdrs addrhdrs ('from''to''cc''bcc' decode specially compute max field sizes <hdrsize maxsize {for key in showhdrsalllens [too big for list compfor msg in hdrmapskeyval msg get(key'if key not in addrhdrsalllens append(len(self decodeheader(keyval))elsealllens append(len(self decodeaddrheader(keyval))if not alllensalllens [ maxsize[keymin(maxhdrsizemax(alllens)populate listbox with fixed-width left-justified fields self listbox delete( endshow multiparts with for (ixmsgin enumerate(hdrmaps)via content-type hdr pymailgui implementation