/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/mail_client.py

  • Committer: Neil Martinsen-Burrell
  • Date: 2008-08-19 03:12:55 UTC
  • mto: (3644.1.2 bzr.dev)
  • mto: This revision was merged to the branch mainline in revision 3646.
  • Revision ID: nmb@wartburg.edu-20080819031255-bs3kjjz8aresvu92
Use a registry for mail clients.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    msgeditor,
28
28
    osutils,
29
29
    urlutils,
 
30
    registry
30
31
    )
31
32
 
 
33
mail_client_registry = registry.Registry()
 
34
# Specific clients
 
35
mail_client_registry.register_lazy(
 
36
                'emacsclient',
 
37
                'bzrlib.mail_client',
 
38
                'EmacsMail')
 
39
mail_client_registry.register_lazy(
 
40
                'evolution',
 
41
                'bzrlib.mail_client',
 
42
                'Evolution')
 
43
mail_client_registry.register_lazy(
 
44
                'kmail',
 
45
                'bzrlib.mail_client',
 
46
                'KMail')
 
47
mail_client_registry.register_lazy(
 
48
                'mutt',
 
49
                'bzrlib.mail_client',
 
50
                'Mutt')
 
51
mail_client_registry.register_lazy(
 
52
                'thunderbird',
 
53
                'bzrlib.mail_client',
 
54
                'Thunderbird')
 
55
# Generic options
 
56
mail_client_registry.register_lazy(
 
57
                'default',
 
58
                'bzrlib.mail_client',
 
59
                'DefaultMail')
 
60
mail_client_registry.default_key = 'default'
 
61
 
 
62
mail_client_registry.register_lazy(
 
63
                'editor',
 
64
                'bzrlib.mail_client',
 
65
                'Editor')
 
66
mail_client_registry.register_lazy(
 
67
                'mapi',
 
68
                'bzrlib.mail_client',
 
69
                'MAPIClient')
 
70
mail_client_registry.register_lazy(
 
71
                'xdg-email',
 
72
                'bzrlib.mail_client',
 
73
                'XDGEmail')
32
74
 
33
75
class MailClient(object):
34
76
    """A mail client that can send messages with attachements."""
253
295
    """
254
296
 
255
297
    _client_commands = ['thunderbird', 'mozilla-thunderbird', 'icedove',
256
 
        '/Applications/Mozilla/Thunderbird.app/Contents/MacOS/thunderbird-bin']
 
298
        '/Applications/Mozilla/Thunderbird.app/Contents/MacOS/thunderbird-bin',
 
299
        '/Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin']
257
300
 
258
301
    def _get_compose_commandline(self, to, subject, attach_path):
259
302
        """See ExternalMailClient._get_compose_commandline"""