def __init__(self, mail=None, server='localhost', show_to=True, show_cc=True, show_bcc=False): """ Create a new editor window. All arguments are passed to the underlying MailWidget. @type mail: Exscript.util.mail.Mail @param mail: An optional email object to attach. @type server: string @param server: The address of the mailserver. @type show_to: bool @param show_to: Whether to show the "To:" entry box. @type show_cc: bool @param show_cc: Whether to show the "Cc:" entry box. @type show_bcc: bool @param show_bcc: Whether to show the "Bcc:" entry box. """ self.widget = None Frame.__init__(self) self.pack(expand=True, fill=BOTH) self.widget = MailWidget(self, mail, server=server, show_to=show_to, show_cc=show_cc, show_bcc=show_bcc, on_subject_changed=self._update_subject) self.widget.pack(expand=True, fill=BOTH, padx=6, pady=6) self._on_subject_changed(None)
class MailWindow(Frame): """ A simple TkFrame that shows a MailWidget. This class supports all of the same methods that MailWidget supports; any calls are proxied directly to the underlying widget. """ def __init__(self, mail = None, server = 'localhost', show_to = True, show_cc = True, show_bcc = False): """ Create a new editor window. All arguments are passed to the underlying MailWidget. @type mail: Exscript.util.mail.Mail @param mail: An optional email object to attach. @type server: string @param server: The address of the mailserver. @type show_to: bool @param show_to: Whether to show the "To:" entry box. @type show_cc: bool @param show_cc: Whether to show the "Cc:" entry box. @type show_bcc: bool @param show_bcc: Whether to show the "Bcc:" entry box. """ self.widget = None Frame.__init__(self) self.pack(expand = True, fill = BOTH) self.widget = MailWidget(self, mail, server = server, show_to = show_to, show_cc = show_cc, show_bcc = show_bcc, on_subject_changed = self._update_subject) self.widget.pack(expand = True, fill = BOTH, padx = 6, pady = 6) self._on_subject_changed(None) def _update_subject(self): subject = self.widget.get_mail().get_subject() if subject: self.master.title(subject) else: self.master.title('Send a mail') def __getattr__(self, name): return getattr(self.widget, name)
class MailWindow(Frame): """ A simple TkFrame that shows a MailWidget. This class supports all of the same methods that MailWidget supports; any calls are proxied directly to the underlying widget. """ def __init__(self, mail=None, server='localhost', show_to=True, show_cc=True, show_bcc=False): """ Create a new editor window. All arguments are passed to the underlying MailWidget. @type mail: Exscript.util.mail.Mail @param mail: An optional email object to attach. @type server: string @param server: The address of the mailserver. @type show_to: bool @param show_to: Whether to show the "To:" entry box. @type show_cc: bool @param show_cc: Whether to show the "Cc:" entry box. @type show_bcc: bool @param show_bcc: Whether to show the "Bcc:" entry box. """ self.widget = None Frame.__init__(self) self.pack(expand=True, fill=BOTH) self.widget = MailWidget(self, mail, server=server, show_to=show_to, show_cc=show_cc, show_bcc=show_bcc, on_subject_changed=self._update_subject) self.widget.pack(expand=True, fill=BOTH, padx=6, pady=6) self._on_subject_changed(None) def _update_subject(self): subject = self.widget.get_mail().get_subject() if subject: self.master.title(subject) else: self.master.title('Send a mail') def __getattr__(self, name): return getattr(self.widget, name)
def __init__(self, mail = None, server = 'localhost', show_to = True, show_cc = True, show_bcc = False): """ Create a new editor window. All arguments are passed to the underlying MailWidget. @type mail: Exscript.util.mail.Mail @param mail: An optional email object to attach. @type server: string @param server: The address of the mailserver. @type show_to: bool @param show_to: Whether to show the "To:" entry box. @type show_cc: bool @param show_cc: Whether to show the "Cc:" entry box. @type show_bcc: bool @param show_bcc: Whether to show the "Bcc:" entry box. """ self.widget = None Frame.__init__(self) self.pack(expand = True, fill = BOTH) self.widget = MailWidget(self, mail, server = server, show_to = show_to, show_cc = show_cc, show_bcc = show_bcc, on_subject_changed = self._update_subject) self.widget.pack(expand = True, fill = BOTH, padx = 6, pady = 6) self._on_subject_changed(None)