------------------------------------------------------------
revno: 17
fixes bugs: https://launchpad.net/bugs/882491 https://launchpad.net/bugs/882395
committer: Florian Fuchs <[email protected]>
branch nick: mailman.client
timestamp: Thu 2011-10-27 12:17:10 +0200
message:
  - Fixes bug lp:882491 (breaking tests, caused by renaming of config sections 
in MM core)
  - Fixes bug lp:882395 (renaming of email_host attribute)
modified:
  mailman/client/_client.py
  mailman/client/docs/using.txt
  mailman/client/tests/test_docs.py


--
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	2011-08-08 07:14:48 +0000
+++ mailman/client/_client.py	2011-10-27 10:17:10 +0000
@@ -167,9 +167,9 @@
                 for entry in sorted(content['entries'],
                                     key=_member_key)]
 
-    def create_domain(self, email_host, base_url=None,
+    def create_domain(self, mail_host, base_url=None,
                       description=None, contact_address=None):
-        data = dict(email_host=email_host)
+        data = dict(mail_host=mail_host)
         if base_url is not None:
             data['base_url'] = base_url
         if description is not None:
@@ -179,11 +179,11 @@
         response, content = self._connection.call('domains', data)
         return _Domain(self._connection, response['location'])
 
-    def get_domain(self, email_host=None, web_host=None):
-        """Get domain by its email_host or its web_host."""
-        if email_host is not None:
+    def get_domain(self, mail_host=None, web_host=None):
+        """Get domain by its mail_host or its web_host."""
+        if mail_host is not None:
             response, content = self._connection.call(
-                'domains/{0}'.format(email_host))
+                'domains/{0}'.format(mail_host))
             return _Domain(self._connection, content['self_link'])
         elif web_host is not None:
             for domain in self.domains:
@@ -211,7 +211,7 @@
         self._info = None
 
     def __repr__(self):
-        return '<Domain "{0}">'.format(self.email_host)
+        return '<Domain "{0}">'.format(self.mail_host)
 
     def _get_info(self):
         if self._info is None:
@@ -236,9 +236,9 @@
         return self._info['description']
 
     @property
-    def email_host(self):
+    def mail_host(self):
         self._get_info()
-        return self._info['email_host']
+        return self._info['mail_host']
 
     @property
     def url_host(self):
@@ -246,13 +246,12 @@
         return self._info['url_host']
 
     def create_list(self, list_name):
-        fqdn_listname = '{0}@{1}'.format(list_name, self.email_host)
+        fqdn_listname = '{0}@{1}'.format(list_name, self.mail_host)
         response, content = self._connection.call(
             'lists', dict(fqdn_listname=fqdn_listname))
         return _List(self._connection, response['location'])
 
 
-
 class _List:
     def __init__(self, connection, url):
         self._connection = connection
@@ -273,9 +272,9 @@
         return self._info['fqdn_listname']
 
     @property
-    def host_name(self):
+    def mail_host(self):
         self._get_info()
-        return self._info['host_name']
+        return self._info['mail_host']
 
     @property
     def list_name(self):
@@ -289,8 +288,8 @@
 
     @property
     def members(self):
-        response, content = self._connection.call(
-            'lists/{0}/roster/members'.format(self.fqdn_listname))
+        data = dict(fqdn_listname=self.fqdn_listname)
+        response, content = self._connection.call('members/find', data)
         if 'entries' not in content:
             return []
         return [_Member(self._connection, entry['self_link'])
@@ -407,7 +406,7 @@
 
 
 READ_ONLY_ATTRS = ('bounces_address', 'created_at', 'digest_last_sent_at',
-                   'fqdn_listname', 'http_etag', 'host_name', 'join_address',
+                   'fqdn_listname', 'http_etag', 'mail_host', 'join_address',
                    'last_post_at', 'leave_address', 'list_id', 'list_name',
                    'next_digest_number', 'no_reply_address', 'owner_address',
                    'post_id', 'posting_address', 'request_address', 'scheme',

=== modified file 'mailman/client/docs/using.txt'
--- mailman/client/docs/using.txt	2011-08-08 07:14:48 +0000
+++ mailman/client/docs/using.txt	2011-10-27 10:17:10 +0000
@@ -45,7 +45,7 @@
     [email protected]
     >>> print example_dot_com.description
     None
-    >>> print example_dot_com.email_host
+    >>> print example_dot_com.mail_host
     example.com
     >>> print example_dot_com.url_host
     example.com
@@ -79,8 +79,8 @@
     <Domain "example.net">
     >>> client.create_domain('example.org')
     <Domain "example.org">
-    >>> for email_host in client.domains:
-    ...     print email_host
+    >>> for mail_host in client.domains:
+    ...     print mail_host
     <Domain "example.com">
     <Domain "example.net">
     <Domain "example.org">
@@ -96,7 +96,7 @@
     <List "[email protected]">
     >>> print test_one.fqdn_listname
     [email protected]
-    >>> print test_one.host_name
+    >>> print test_one.mail_host
     example.com
     >>> print test_one.list_name
     test-one
@@ -195,9 +195,9 @@
     >>> print cris.role
     member
     >>> print cris.self_link
-    http://localhost:8001/3.0/members/4
+    http://localhost:8001/3.0/members/...
     >>> print cris.user
-    http://localhost:8001/3.0/users/3
+    http://localhost:8001/3.0/users/...
 
 If you use an address which is not a member of test_two `ValueError` is raised:
 

=== modified file 'mailman/client/tests/test_docs.py'
--- mailman/client/tests/test_docs.py	2010-12-26 15:24:41 +0000
+++ mailman/client/tests/test_docs.py	2011-10-27 10:17:10 +0000
@@ -91,27 +91,27 @@
 [paths.tmpdir]
 var_dir: {vardir}
 log_dir: /tmp/mmclient/logs
-[qrunner.archive]
-start: no
-[qrunner.bounces]
-start: no
-[qrunner.command]
-start: no
-[qrunner.in]
-start: no
-[qrunner.lmtp]
-start: no
-[qrunner.news]
-start: no
-[qrunner.out]
-start: no
-[qrunner.pipeline]
-start: no
-[qrunner.retry]
-start: no
-[qrunner.virgin]
-start: no
-[qrunner.digest]
+[runner.archive]
+start: no
+[runner.bounces]
+start: no
+[runner.command]
+start: no
+[runner.in]
+start: no
+[runner.lmtp]
+start: no
+[runner.news]
+start: no
+[runner.out]
+start: no
+[runner.pipeline]
+start: no
+[runner.retry]
+start: no
+[runner.virgin]
+start: no
+[runner.digest]
 start: no
 """.format(vardir=vardir)
     mailman = os.path.join(testobj._bindir, 'mailman')

_______________________________________________
Mailman-coders mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-coders

Reply via email to