------------------------------------------------------------
revno: 11
committer: Barry Warsaw <[email protected]>
branch nick: trunk
timestamp: Sun 2010-12-26 16:00:02 -0500
message:
Mailing list members.
modified:
mailman/client/_client.py
mailman/client/docs/using.txt
--
lp:mailman.client
https://code.launchpad.net/~mailman-coders/mailman.client/trunk
Your team Mailman Coders is subscribed to branch lp:mailman.client.
To unsubscribe from this branch go to
https://code.launchpad.net/~mailman-coders/mailman.client/trunk/+edit-subscription
=== modified file 'mailman/client/_client.py'
--- mailman/client/_client.py 2010-12-26 19:07:13 +0000
+++ mailman/client/_client.py 2010-12-26 21:00:02 +0000
@@ -272,6 +272,16 @@
self._get_info()
return self._info['real_name']
+ @property
+ def members(self):
+ response, content = self._connection.call(
+ 'lists/{0}/roster/members'.format(self.fqdn_listname))
+ if 'entries' not in content:
+ return []
+ return [_Member(self._connection, entry['self_link'])
+ for entry in sorted(content['entries'],
+ key=itemgetter('address'))]
+
def subscribe(self, address, real_name=None):
"""Subscribe an email address to a mailing list.
=== modified file 'mailman/client/docs/using.txt'
--- mailman/client/docs/using.txt 2010-12-26 19:07:13 +0000
+++ mailman/client/docs/using.txt 2010-12-26 21:00:02 +0000
@@ -157,3 +157,10 @@
<Member "[email protected]" on "[email protected]">
<Member "[email protected]" on "[email protected]">
<Member "[email protected]" on "[email protected]">
+
+We can also view the memberships for a single mailing list.
+
+ >>> for member in test_one.members:
+ ... print member
+ <Member "[email protected]" on "[email protected]">
+ <Member "[email protected]" on "[email protected]">
_______________________________________________
Mailman-coders mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-coders