~barry/mailman/events-and-web

« back to all changes in this revision

Viewing changes to src/mailman/interfaces/listmanager.py

  • Committer: Barry Warsaw
  • Date: 2011-08-18 00:39:11 UTC
  • mfrom: (7036.1.4 bug-827036)
  • Revision ID: barry@list.org-20110818003911-9gef1p84g2pg4p10
 * Four new events are created, and notifications are sent during mailing list
   lifecycle changes:
   - ListCreatingEvent - sent before the mailing list is created
   - ListCreatedEvent  - sent after the mailing list is created
   - ListDeletingEvent - sent before the mailing list is deleted
   - ListDeletedEvent  - sent after the mailing list is deleted
 * Using the above events, when a mailing list is deleted, all its members are
   deleted, as well as all held message requests (but not the held messages
   themselves).  (LP: 827036)

Also: relax the find_member() argument constraints so that even the subscriber
email address is optional.  This is mirrored in the REST API's
.../members/find resource.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
__all__ = [
24
24
    'IListManager',
25
25
    'ListAlreadyExistsError',
 
26
    'ListCreatedEvent',
 
27
    'ListCreatingEvent',
 
28
    'ListDeletedEvent',
 
29
    'ListDeletingEvent',
26
30
    'NoSuchListError',
27
31
    ]
28
32
 
51
55
        return 'No such mailing list: {0.fqdn_listname}'.format(self)
52
56
 
53
57
 
 
58
class ListCreatingEvent:
 
59
    """A mailing list is about to be created."""
 
60
 
 
61
    def __init__(self, fqdn_listname):
 
62
        self.fqdn_listname = fqdn_listname
 
63
 
 
64
 
 
65
class ListCreatedEvent:
 
66
    """A mailing list was created."""
 
67
 
 
68
    def __init__(self, mlist):
 
69
        self.mailing_list = mlist
 
70
 
 
71
 
 
72
class ListDeletingEvent:
 
73
    """A mailing list is about to be deleted."""
 
74
 
 
75
    def __init__(self, mailing_list):
 
76
        self.mailing_list = mailing_list
 
77
 
 
78
 
 
79
class ListDeletedEvent:
 
80
    """A mailing list was deleted."""
 
81
 
 
82
    def __init__(self, fqdn_listname):
 
83
        self.fqdn_listname = fqdn_listname
 
84
 
 
85
 
54
86
 
55
87
 
56
88
class IListManager(Interface):