~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smtp_connection.py

  • Committer: Adeodato Simó
  • Date: 2007-06-20 00:22:45 UTC
  • mto: (2547.1.1 Aaron's integration)
  • mto: This revision was merged to the branch mainline in revision 2548.
  • Revision ID: dato@net.com.org.es-20070620002245-t4ugu7418qmkdtmv
Import full email.Utils module instead of individual functions, as per
Aaron's review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""A convenience class around smtplib."""
18
18
 
19
 
from email.Utils import getaddresses, parseaddr
 
19
from email import Utils
20
20
import smtplib
21
21
 
22
22
from bzrlib import ui
84
84
            address in the From header, and to_emails a list of all the
85
85
            addresses in the To, Cc, and Bcc headers.
86
86
        """
87
 
        from_email = parseaddr(message['From'])[1]
 
87
        from_email = Utils.parseaddr(message['From'])[1]
88
88
        to_full_addresses = []
89
89
        for header in ['To', 'Cc', 'Bcc']:
90
90
            to_full_addresses += message.get_all(header, [])
91
 
        to_emails = [ pair[1] for pair in getaddresses(to_full_addresses) ]
 
91
        to_emails = [ pair[1] for pair in
 
92
                Utils.getaddresses(to_full_addresses) ]
92
93
 
93
94
        return from_email, to_emails
94
95