~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mail_client.py

  • Committer: Neil Martinsen-Burrell
  • Date: 2008-08-19 19:49:06 UTC
  • mto: (3644.1.2 bzr.dev)
  • mto: This revision was merged to the branch mainline in revision 3646.
  • Revision ID: nmb@wartburg.edu-20080819194906-ozq57i7uozwnwpos
use docstrings as help messages for registered mail clients

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
                                        body,
113
113
                                        attachment,
114
114
                                        attachment_mime_subtype=mime_subtype)
115
 
mail_client_registry.register('editor', Editor)
 
115
mail_client_registry.register('editor', Editor,
 
116
                              help=Editor.__doc__)
116
117
 
117
118
 
118
119
class ExternalMailClient(MailClient):
226
227
                        sorted(message_options.iteritems())]
227
228
        return ['mailto:%s?%s' % (self._encode_safe(to or ''),
228
229
            '&'.join(options_list))]
229
 
mail_client_registry.register('evolution', Evolution)
 
230
mail_client_registry.register('evolution', Evolution,
 
231
                              help=Evolution.__doc__)
230
232
 
231
233
 
232
234
class Mutt(ExternalMailClient):
245
247
        if to is not None:
246
248
            message_options.append(self._encode_safe(to))
247
249
        return message_options
248
 
mail_client_registry.register('mutt', Mutt)
 
250
mail_client_registry.register('mutt', Mutt,
 
251
                              help=Mutt.__doc__)
249
252
 
250
253
 
251
254
class Thunderbird(ExternalMailClient):
275
278
        options_list = ["%s='%s'" % (k, v) for k, v in
276
279
                        sorted(message_options.iteritems())]
277
280
        return ['-compose', ','.join(options_list)]
278
 
mail_client_registry.register('thunderbird', Thunderbird)
 
281
mail_client_registry.register('thunderbird', Thunderbird,
 
282
                              help=Thunderbird.__doc__)
279
283
 
280
284
 
281
285
class KMail(ExternalMailClient):
294
298
        if to is not None:
295
299
            message_options.extend([self._encode_safe(to)])
296
300
        return message_options
297
 
mail_client_registry.register('kmail', KMail)
 
301
mail_client_registry.register('kmail', KMail,
 
302
                              help=KMail.__doc__)
298
303
 
299
304
 
300
305
class XDGEmail(ExternalMailClient):
313
318
            commandline.extend(['--attach',
314
319
                self._encode_path(attach_path, 'attachment')])
315
320
        return commandline
316
 
mail_client_registry.register('xdg-email', XDGEmail)
 
321
mail_client_registry.register('xdg-email', XDGEmail,
 
322
                              help=XDGEmail.__doc__)
317
323
 
318
324
 
319
325
class EmacsMail(ExternalMailClient):
415
421
            commandline.append(rmform)
416
422
 
417
423
        return commandline
418
 
mail_client_registry.register('emacsclient', EmacsMail)
 
424
mail_client_registry.register('emacsclient', EmacsMail,
 
425
                              help=EmacsMail.__doc__)
419
426
 
420
427
 
421
428
class MAPIClient(ExternalMailClient):
434
441
            if e.code != simplemapi.MAPI_USER_ABORT:
435
442
                raise errors.MailClientNotFound(['MAPI supported mail client'
436
443
                                                 ' (error %d)' % (e.code,)])
437
 
mail_client_registry.register('mapi', MAPIClient)
 
444
mail_client_registry.register('mapi', MAPIClient,
 
445
                              help=MAPIClient.__doc__)
438
446
 
439
447
 
440
448
class DefaultMail(MailClient):
467
475
        except errors.MailClientNotFound:
468
476
            return Editor(self.config).compose_merge_request(to, subject,
469
477
                          directive, basename=basename)
470
 
mail_client_registry.register('default', DefaultMail)
 
478
mail_client_registry.register('default', DefaultMail,
 
479
                              help=DefaultMail.__doc__)
471
480
mail_client_registry.default_key = 'default'