if delete of all msgnums worksremove deleted entries from mail cachebut don' reload either the headers list or already viewed mails textcache list will reflect the changed msg nums on serverif delete fails for any reasoncaller should forceably reload all hdrs nextbecause _some_ server msg nums may have changedin unpredictable ways this now checks msg hdrs to detect out of synch msg numbersif top supported by mail serverruns in thread ""tryself deletemessagessafely(msgnumsself allhdrs()progressexcept mailtools topnotsupportedmailtools mailfetcher deletemessages(selfmsgnumsprogressno errorsupdate index list indexed enumerate(self msglistself msglist [msg for (ixmsgin indexed if ix+ not in msgnumsclass guimessagecache(messagecache)""add any gui-specific calls here so cache usable in non-gui apps ""def setpoppassword(selfappname)""get password from gui herein main thread forceably called from gui to avoid pop ups in threads ""if not self poppasswordprompt 'password for % on % ?(self popuserself popserverself poppassword askpasswordwindow(appnamepromptdef askpoppassword(self)""but don' use gui pop up herei am run in threadwhen tried pop up in threadcaused gui to hangmay be called by mailfetcher superclassbut only if passwd is still empty string due to dialog close ""return self poppassword popuputilgeneral-purpose gui pop ups example - implements handful of utility pop-up windows in modulein case they ever prove useful in other programs note that the same windows utility module is imported hereto give common look-and-feel to the pop ups (iconstitlesand so on the pymailgui client