~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mail_client.py

  • Committer: Vincent Ladeuil
  • Date: 2011-12-19 16:41:49 UTC
  • mfrom: (6386 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6387.
  • Revision ID: v.ladeuil+lp@free.fr-20111219164149-ecfrvwscqb6v77jn
Merge trunk to resolve news conflicts

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()