~varun/mailman/mailman

« back to all changes in this revision

Viewing changes to src/mailman/app/events.py

  • Committer: Barry Warsaw
  • Date: 2014-01-07 03:43:59 UTC
  • Revision ID: barry@list.org-20140107034359-quszchw34yy65qt0
Several internal improvements:

* New events:
  - ConfirmationNeededEvent is triggered when a pendable requiring
    confirmation is created.  This allows us to define an event handler for
    this event which sends the user notification.
  - SubscriptionEvent is triggered when a member is added to a mailing list.
    This lets us define an event handler which sends the welcome message.
* send_welcome_message() now takes a member parameter instead of an address,
  which lets us directly access the member's delivery mode and user display
  name (if the member has a user, which it might not in some cases).
* Use the list id in the pendable record instead of the list name for
  robustness (the latter can change but the former is permanent).
* Test more registration conditions.
* In the bin/runner command line switch handling, default `verbose` to None
  instead of False.  This makes it work better with nose's -E switch (log to
  stderr).
* In call_api(), if a POST, PUT, or PATCH method is used and data is None,
  encode the empty dictionary; seems like the behavior of urlencode() has
  changed, so this is safer.
* Fix style and pyflakes warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
from zope import event
29
29
 
30
 
from mailman.app import domain, moderator, subscriptions
 
30
from mailman.app import (
 
31
    domain, membership, moderator, registrar, subscriptions)
31
32
from mailman.core import i18n, switchboard
32
33
from mailman.languages import manager as language_manager
33
34
from mailman.styles import manager as style_manager
39
40
    """Initialize global event subscribers."""
40
41
    event.subscribers.extend([
41
42
        domain.handle_DomainDeletingEvent,
 
43
        i18n.handle_ConfigurationUpdatedEvent,
 
44
        language_manager.handle_ConfigurationUpdatedEvent,
 
45
        membership.handle_SubscriptionEvent,
42
46
        moderator.handle_ListDeletingEvent,
43
47
        passwords.handle_ConfigurationUpdatedEvent,
 
48
        registrar.handle_ConfirmationNeededEvent,
 
49
        style_manager.handle_ConfigurationUpdatedEvent,
44
50
        subscriptions.handle_ListDeletingEvent,
45
51
        switchboard.handle_ConfigurationUpdatedEvent,
46
 
        i18n.handle_ConfigurationUpdatedEvent,
47
 
        style_manager.handle_ConfigurationUpdatedEvent,
48
 
        language_manager.handle_ConfigurationUpdatedEvent,
49
52
        ])