Bibek Shrestha wrote:
>
>If i have to hook into user's subscriptions (new/edit/remove) and then
>perform specific non mailman related activities, how do I go about it?


Barry has answered for MM3. For MM 2.1, there are no hooks for this
built in. You would have to add your own.

The most elegant way to do this would be create your own MemberAdaptor
as a subclass of whatever MemberAdaptor you are currently using.
Mailman by default uses OldStyleMemberships.OldStyleMemberships which
itself is a subclass of the generic MemberAdaptor.MemberAdaptor class.

You could create MyMemberAdaptor.py in the Mailman/ directory to contain

from Mailman import OldStyleMemberships

class MyMemberAdaptor(OldStyleMemberships.OldStyleMemberships):

and then override those methods you want to hook into.

Then, there are a couple of ways to enable this MemberAdaptor. To
enable it for one or a few lists, place a file named extend.py in the
lists/LISTNAME/ directory for the list(s). This file contains

from Mailman.MyMemberAdaptor import MyMemberAdaptor
def extend(mlist):
    mlist._memberadaptor = MyMemberAdaptor(mlist)

To enable it for all lists, you could patch MailList.py, adding

from Mailman.MyMemberAdaptor import MyMemberAdaptor

and changing

        # Default membership adaptor class
        self._memberadaptor = OldStyleMemberships(self)

to

        # Default membership adaptor class
        self._memberadaptor = MyMemberAdaptor(self)


-- 
Mark Sapiro <m...@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

_______________________________________________
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9

Reply via email to