~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mail_client.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-19 10:58:39 UTC
  • mfrom: (6383 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6386.
  • Revision ID: jelmer@canonical.com-20111219105839-uji05ck4rkm1mj4j
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import subprocess
22
22
import sys
23
23
import tempfile
24
 
import urllib
25
24
 
26
25
import bzrlib
27
26
from bzrlib import (
312
311
            message_options['attachment'] = urlutils.local_path_to_url(
313
312
                attach_path)
314
313
        if body is not None:
315
 
            options_list = ['body=%s' % urllib.quote(self._encode_safe(body))]
 
314
            options_list = ['body=%s' % urlutils.quote(self._encode_safe(body))]
316
315
        else:
317
316
            options_list = []
318
317
        options_list.extend(["%s='%s'" % (k, v) for k, v in
354
353
        """See ExternalMailClient._get_compose_commandline"""
355
354
        compose_url = []
356
355
        if from_ is not None:
357
 
            compose_url.append('from=' + urllib.quote(from_))
 
356
            compose_url.append('from=' + urlutils.quote(from_))
358
357
        if subject is not None:
359
 
            # Don't use urllib.quote_plus because Claws doesn't seem
 
358
            # Don't use urlutils.quote_plus because Claws doesn't seem
360
359
            # to recognise spaces encoded as "+".
361
360
            compose_url.append(
362
 
                'subject=' + urllib.quote(self._encode_safe(subject)))
 
361
                'subject=' + urlutils.quote(self._encode_safe(subject)))
363
362
        if body is not None:
364
363
            compose_url.append(
365
 
                'body=' + urllib.quote(self._encode_safe(body)))
 
364
                'body=' + urlutils.quote(self._encode_safe(body)))
366
365
        # to must be supplied for the claws-mail --compose syntax to work.
367
366
        if to is None:
368
367
            raise errors.NoMailAddressSpecified()