Commit ef30372e authored by Florian Fuchs's avatar Florian Fuchs

added nonmember property to list objects.

added add_address method to user objects.
parent 84e1e63c
......@@ -24,12 +24,11 @@ from setuptools import setup, find_packages
__version__ = get_version('src/mailmanclient/')
package_dir = {'': 'src'},
......@@ -381,6 +381,20 @@ class _List:
for entry in sorted(content['entries'],
def nonmembers(self):
url = 'members/find'
data = {
'role': 'nonmember',
'list_id': self.list_id
response, content =, data)
if 'entries' not in content:
return []
return [_Member(self._connection, entry['self_link'])
for entry in sorted(content['entries'],
def get_member_page(self, count=50, page=1):
url = 'lists/{0}/roster/member'.format(self.fqdn_listname)
return _Page(self._connection, url, _Member, count, page)
......@@ -690,6 +704,12 @@ class _User:
self._preferences = _Preferences(self._connection, path)
return self._preferences
def add_address(self, email):
# Adds another email adress to the user record and returns an
# _Address object.
url = '{0}/addresses'.format(self._url), {'email': email})
def save(self):
data = {'display_name': self.display_name}
if self._cleartext_password is not None:
......@@ -302,6 +302,7 @@ If you use an address which is not a member of test_two `ValueError` is raised:
After a while, Anna decides to unsubscribe from the Test One mailing list,
though she keeps her Test Two membership active.
>>> time.sleep(2)
>>> test_one.unsubscribe('')
>>> for member in client.members:
... print member
......@@ -336,7 +337,7 @@ Users are people with one or more list memberhips. To get a list of all users, a
<User "..." (...)>
<User "..." (...)>
The users can also be paginated:
The list of users can also be paginated:
>>> page = client.get_user_page(count=2, page=1)
......@@ -381,6 +382,21 @@ Every user has a list of one or more addresses.
Multiple addresses can be assigned to a user record:
>>> cris.add_address('')
>>> print client.get_address('')
>>> for address in cris.addresses:
... print address
Addresses can be accessed directly:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment