~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-18 15:43:47 UTC
  • mto: This revision was merged to the branch mainline in revision 6383.
  • Revision ID: jelmer@samba.org-20111218154347-d42sxp2qzn36uo2r
Add urlutils.quote / urlutils.unquote.

Show diffs side-by-side

added added

removed removed

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