~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mail_client.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:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
import errno
20
18
import os
21
19
import subprocess
22
20
import sys
23
21
import tempfile
 
22
import urllib
24
23
 
25
24
import bzrlib
26
25
from bzrlib import (
311
310
            message_options['attachment'] = urlutils.local_path_to_url(
312
311
                attach_path)
313
312
        if body is not None:
314
 
            options_list = ['body=%s' % urlutils.quote(self._encode_safe(body))]
 
313
            options_list = ['body=%s' % urllib.quote(self._encode_safe(body))]
315
314
        else:
316
315
            options_list = []
317
316
        options_list.extend(["%s='%s'" % (k, v) for k, v in
353
352
        """See ExternalMailClient._get_compose_commandline"""
354
353
        compose_url = []
355
354
        if from_ is not None:
356
 
            compose_url.append('from=' + urlutils.quote(from_))
 
355
            compose_url.append('from=' + urllib.quote(from_))
357
356
        if subject is not None:
358
 
            # Don't use urlutils.quote_plus because Claws doesn't seem
 
357
            # Don't use urllib.quote_plus because Claws doesn't seem
359
358
            # to recognise spaces encoded as "+".
360
359
            compose_url.append(
361
 
                'subject=' + urlutils.quote(self._encode_safe(subject)))
 
360
                'subject=' + urllib.quote(self._encode_safe(subject)))
362
361
        if body is not None:
363
362
            compose_url.append(
364
 
                'body=' + urlutils.quote(self._encode_safe(body)))
 
363
                'body=' + urllib.quote(self._encode_safe(body)))
365
364
        # to must be supplied for the claws-mail --compose syntax to work.
366
365
        if to is None:
367
366
            raise errors.NoMailAddressSpecified()