1
  H   ˆl–Ü4ý(ÔËmJiA3q§n*bÑ¿“þY•¥œåq±¸Ëm4¦öjÿŸÁÈÇÆ536_‹I|¥Žƒî4ÃVŸÅÄ     ‹      �SM‹Û0½ûWL}ØÚa#o PÈâ¶”²×¶”Â²ÅÛ"¶d¤ñ:!¤¿½#ÛI½‡^’‘ôfÞ¼yãd±`÷²�VÁŸÕ
*é@jPÎu}…á‰ßä¶FÈ1«¥•¤Œv 4H¸3IÂ5UÖô 
ð ®’9[Îh�Ð:á©~VŠsj�9l`QËFé’Y¯¸ÔXP¢´"_ŠÀ#ïbFìÌH™ýž&â�í‹C„Š¨uë$Ùv¥=nwŠ„±eâ*ÓoøRd¥ú¬òtõquóaÅiC&îeÓÖèc „ô¡`¹Q�Ägnãá1æàÄÏI2jwo£7øæ‚ï�ÝyxE§3¯˜g¯ó£Ùb8à'½›Ý
å~Mž|ûwÅ1“:«oNÊx„…†t>UQ"ÝM|?$Ïž¢øö‚>{á[|ž£MŽbnÍÃÍ£Pù@ÃR²
³Ýd;¯›+'¼ÃJçÞÝÌ&Ö4ü|YŠIÿ�ïõêjŠ„ËL‹‚·ñ{¯¿Ž5"ß\ü
ÃŠ^bÄŽO�¦)„SÈã(á™°±À°�8fúYœ‚Sà¾5¼m9²«	¢Ø{ù·†�¬ÔŽ-n–nøz–/GÙÜGxÍÈ'å»ž˜yißŸw6j%Uçžàl½¿ô‚¢Ðo}ýpG×Á¹Âð_Ì¼Àðsâó_Ð™È>ô       ˆÉÈÇ‚pÆÅÄ Y    ‹      Õ–ÝoÚ0ÀßûWx~Ø¡Ÿkƒ§Ž �¢LÓ4M•‰±šØ‘m`ô¯ŸƒÓ6�@£R©Ú§»‹/w÷³Ïá‡hÐÿvÐ×ñU¿éuÛ× ~¶¢qäŽê�  ÓÇ'Öæç Ëå²¾<¬+=ƒñ›¥G`¬±­3Ë09‹oä …	§ÌIZaSNº’ñ?HM¨¹5‚q÷ßÊ ãsSè–g�ñLéU)‚æHÅx£´�Ÿšg!øØ.”éÂ‰b«¢Š`O]à5�¬ª&¡MÐ‚¦b&[Øª“Pd3dtÜÂ b%LR*oë31Åˆ¦¶…uÛƒßÎlRüMBŠÍ§-ü¹Ýê_Z&}šñèfŸ+çs‰I�‹2ÅÄTp¶ÕùÚ;_‹»í#ïqk‘[¡ä£+8Ä*j¬R“SÇzì]õò.ì³Aã'“1¼uúã¨;òSÂŠ�Õ½Àúa2¤šK‹"¡ylÝPIçS}”“_Ü›¨¬]‹Yb1A¨†6z>xªRÆuyì}½^V«ü§¬f£yR‚Zð	§ç�„öXÿ\ÞJµ”U ×”L…ä˜x¹@3@�ÓóæÑV w
}{E€<Y™ße˜TŒ÷Š"Šs°$Yë;ƒÇ{Ù}SäjÉµÛ^¾ÄB¼ò¦Ðî8ZW&ê[Y†g`K­CX‹·²vï"3Ÿ”—†CxÐßá;çw—aâåK ¼r�ØÍ�’Ü`R1ößS;¾b |ß…°~O†à_µ€³{ç8    B   ˆl–Ü4ý( ©”u( 	•íÀà™S�ÿ�þ\i–ÖnQðÈ0„¤óÃ„n6ÏÈ_ŠI|¥�+Wé3ž¯ÇÆ ?÷     # Copyright (C) 2007-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

import errno
import os
import subprocess
import sys
import tempfile
from typing import Type

import breezy
from . import (
    config as _mod_config,
    email_message,
    errors,
    msgeditor,
    osutils,
    urlutils,
    registry,
    )

class MailClientNotFound(errors.BzrError):

    _fmt = "Unable to find mail client with the following names:"\
        " %(mail_command_list_string)s"

    def __init__(self, mail_command_list):
        mail_command_list_string = ', '.join(mail_command_list)
        errors.BzrError.__init__(
            self, mail_command_list=mail_command_list,
            mail_command_list_string=mail_command_list_string)


class NoMessageSupplied(errors.BzrError):

    _fmt = "No message supplied."


class NoMailAddressSpecified(errors.BzrError):

    _fmt = "No mail-to address (--mail-to) or output (-o) specified."


class MailClient:
    """A mail client that can send messages with attachements."""

    def __init__(self, config):
        self.config = config

    def compose(self, prompt, to, subject, attachment, mime_subtype,
                extension, basename=None, body=None):
        """Compose (and possibly send) an email message

        Must be implemented by subclasses.

        :param prompt: A message to tell the user what to do.  Supported by
            the Editor client, but ignored by others
        :param to: The address to send the message to
        :param subject: The contents of the subject line
        :param attachment: An email attachment, as a bytestring
        :param mime_subtype: The attachment is assumed to be a subtype of
            Text.  This allows the precise subtype to be specified, e.g.
            "plain", "x-patch", etc.
        :param extension: The file extension associated with the attachment
            type, e.g. ".patch"
        :param basename: The name to use for the attachment, e.g.
            "send-nick-3252"
        """
        raise NotImplementedError

    def compose_merge_request(self, to, su