------------------------------------------------------------
revno: 18
fixes bug: https://launchpad.net/bugs/799689
committer: Florian Fuchs <[email protected]>
branch nick: mailman.client
timestamp: Thu 2011-10-27 12:57:00 +0200
message:
  Added delete_domain('example.com') call to Client
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	2011-10-27 10:17:10 +0000
+++ mailman/client/_client.py	2011-10-27 10:57:00 +0000
@@ -117,7 +117,6 @@
         return response, json.loads(content)
 
 
-
 class Client:
     """Access the Mailman REST API root."""
 
@@ -179,6 +178,9 @@
         response, content = self._connection.call('domains', data)
         return _Domain(self._connection, response['location'])
 
+    def delete_domain(self, mail_host):
+        response, content = self._connection.call('domains/{0}'.format(mail_host), None, 'DELETE')
+
     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:
@@ -356,7 +358,6 @@
             'lists/{0}'.format(self.fqdn_listname), None, 'DELETE')
 
 
-
 class _Member:
     def __init__(self, connection, url):
         self._connection = connection

=== modified file 'mailman/client/docs/using.txt'
--- mailman/client/docs/using.txt	2011-10-27 10:17:10 +0000
+++ mailman/client/docs/using.txt	2011-10-27 10:57:00 +0000
@@ -84,6 +84,14 @@
     <Domain "example.com">
     <Domain "example.net">
     <Domain "example.org">
+    
+Also, domain can be deleted.
+
+    >>> client.delete_domain('example.org')
+    >>> for mail_host in client.domains:
+    ...     print mail_host
+    <Domain "example.com">
+    <Domain "example.net">
 
 
 Mailing lists

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

Reply via email to