~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mail_client.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-06 22:44:57 UTC
  • mfrom: (6436 +trunk)
  • mto: (6437.3.11 2.5)
  • mto: This revision was merged to the branch mainline in revision 6444.
  • Revision ID: jelmer@samba.org-20120106224457-re0pcy0fz31xob77
Merge bzr.dev.

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