[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版
file = open(self.filename, 'r', encoding=mailconfig.fetchEncoding) # 3.0 allmsgs = file.read() self.msglist = allmsgs.split(save ...
def deleteMailFile(self, msgnums): run in a thread while GUI active indexed = enumerate(self.msglist) keepers = [msg for (ix, ms ...
############################################################################### main window - when viewing messages on the mail ...
from PyMailGuiHelp import showHtmlHelp showHtmlHelp() # 3.0: HTML version without source file links def onShowMySource(self, sho ...
onProgress = self.onLoadHdrsProgress) def onLoadHdrsExit(self, popup): self.fillIndex() popup.quit() self.lift() loadingHdrsBusy ...
self.onLoadServer(forceReload=True) # new thread: some msgnums changed def onDeleteProgress(self, i, n, popup): popup.changeText ...
if exc_info[0] == mailtools.MessageSynchError: # synch inbox/index self.onLoadServer(forceReload=True) # new thread: reload def ...
New in 3.0: supports Unicode encodings for main text + text attachments sent. New in 3.0: PyEdit supports arbitrary Unicode for ...
myactions = self.actionButtons() for (label, callback) in myactions: b = Button(actionsframe, text=label, command=callback) b.co ...
self.hdrFields = [] for (i, header) in enumerate(showhdrs): lab = Label(middle, text=header+':', justify=LEFT) ent = Entry(middl ...
could use tempfile module (just like the HTML main text part display code in onView of the list window class); """ try: savedir ...
caveat: punts for type application/octet-stream even if it has safe filename extension such as .html; caveat: image/audio/video ...
elif maintype == 'text': if self.askOpen(appname, 'Open text part "%s"?' % basename): try: encoding = textPartEncoding(fullfilen ...
def actionButtons(self): return [('Cancel', self.quit), # need method to use self ('Parts', self.onParts), # PopupWindow verifie ...
bodytext = self.editor.getAllText() bodytext.encode(bodytextEncoding) except (UnicodeError, LookupError): # lookup: bad encoding ...
get components from GUI; 3.0: i18n headers are decoded fieldvalues = [entry.get() for entry in self.hdrFields] From, To, Cc, Sub ...
MailSenderClass.smtpPassword = None # try again; 3.0/4E: not on self sendingBusy.decr() def askSmtpPassword(self): """ get passw ...
is fetched - mail text is always Unicode str from that point on; this may change in a future Python/email: see Chapter 13 for de ...
load newly arrived, and forced reload after delete; don't refetch viewed msgs if hdrs list same or extended; retains cached msgs ...
""" if delete of all msgnums works, remove deleted entries from mail cache, but don't reload either the headers list or already ...
«
52
53
54
55
56
57
58
59
60
61
»
Free download pdf