~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
import bzrlib
76
76
from bzrlib import (
77
77
    errors,
 
78
    mail_client,
78
79
    osutils,
79
80
    symbol_versioning,
80
81
    trace,
143
144
        """Get the users pop up editor."""
144
145
        raise NotImplementedError
145
146
 
 
147
    def get_mail_client(self):
 
148
        """Get a mail client to use"""
 
149
        selected_client = self.get_user_option('mail_client')
 
150
        try:
 
151
            mail_client_class = {
 
152
                None: mail_client.DefaultMail,
 
153
                'default': mail_client.DefaultMail,
 
154
                'editor': mail_client.Editor,
 
155
                'thunderbird': mail_client.Thunderbird,
 
156
                'evolution': mail_client.Evolution,
 
157
                'mapi': mail_client.MAPIClient,
 
158
                'xdg-email': mail_client.XDGEmail,
 
159
                'kmail': mail_client.KMail,
 
160
            }[selected_client]
 
161
        except KeyError:
 
162
            raise errors.UnknownMailClient(selected_client)
 
163
        return mail_client_class(self)
 
164
 
146
165
    def _get_signature_checking(self):
147
166
        """Template method to override signature checking policy."""
148
167