~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/email_message.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""A convenience class around email.Message and email.MIMEMultipart."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
from email import (
22
20
    Header,
23
21
    Message,
149
147
 
150
148
    @staticmethod
151
149
    def send(config, from_address, to_address, subject, body, attachment=None,
152
 
             attachment_filename=None, attachment_mime_subtype='plain'):
 
150
            attachment_filename=None, attachment_mime_subtype='plain'):
153
151
        """Create an email message and send it with SMTPConnection.
154
152
 
155
153
        :param config: config object to pass to SMTPConnection constructor.
183
181
    def string_with_encoding(string_):
184
182
        """Return a str object together with an encoding.
185
183
 
186
 
        :param string\\_: A str or unicode object.
 
184
        :param string_: A str or unicode object.
187
185
        :return: A tuple (str, encoding), where encoding is one of 'ascii',
188
186
            'utf-8', or '8-bit', in that preferred order.
189
187
        """