def onloadhdrsexit(selfpopup)self fillindex(popup quit(self lift(loadinghdrsbusy decr(allow other actions to run def onloadhdrsfail(selfexc_infopopup)popup quit(showerror(appname'load failed\ % \ %sexc_info[: ]printstack(exc_infosend stack trace to stdout loadinghdrsbusy decr(if exc_info[ =mailtools messagesyncherrorsynch inbox/index self onloadserver(forcereload=truenew threadreload elseself cache poppassword none force re-input next time def onloadhdrsprogress(selfinpopup)popup changetext('% of % (in)def dodelete(selfmsgnumlist)""threadeddelete from server now changes msg numsmay overlap with sends onlydisables all except sends cache deletemessages now checks top result to see if headers match selected mailsin case msgnums out of synch with mail serverposs if mail deleted by other clientor server deletes inbox mail automatically some isps may move mail from inbox to undeliverable on load failure""if loadinghdrsbusy or deletingbusy or loadingmsgsbusyshowerror(appname'cannot delete during load or delete'elsedeletingbusy incr(popup popuputil busyboxnowait(appname'deleting selected mails'threadtools startthreadaction self cache deletemessagesargs (msgnumlist,)context (popup,)onexit self ondeleteexitonfail self ondeletefailonprogress self ondeleteprogressdef ondeleteexit(selfpopup)self fillindex(popup quit(self lift(deletingbusy decr(no need to reload from server refill index with updated cache raise index windowrelease lock def ondeletefail(selfexc_infopopup)popup quit(showerror(appname'delete failed\ % \ %sexc_info[: ]printstack(exc_infodeletingbusy decr(delete or synch check failure pymailgui implementation