Merge lp:~raj-abhilash1/mailman.client/master into lp:mailman.client

Proposed by Abhilash Raj
Status: Needs review
Proposed branch: lp:~raj-abhilash1/mailman.client/master
Merge into: lp:mailman.client
Diff against target: 89 lines (+34/-3)
1 file modified
src/mailmanclient/_client.py (+34/-3)
To merge this branch: bzr merge lp:~raj-abhilash1/mailman.client/master
Reviewer Review Type Date Requested Status
Mailman Coders Pending
Review via email: mp+187105@code.launchpad.net

Description of the change

* added options to create list's keys, retrive list's keys
* user can add his keys, or post his public key data which then gets imported.

To post a comment you must log in.
49. By Abhilash Raj

removed some whitespaces

Unmerged revisions

49. By Abhilash Raj

removed some whitespaces

48. By Abhilash Raj

added settings to import user's public key from keyserver
or from public key data

47. By Abhilash Raj

added a few options for public_key and create_list_keys.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/mailmanclient/_client.py'
2--- src/mailmanclient/_client.py 2013-03-22 18:28:16 +0000
3+++ src/mailmanclient/_client.py 2013-10-04 03:34:36 +0000
4@@ -367,6 +367,11 @@
5 return self._info.get('display_name')
6
7 @property
8+ def public_key(self):
9+ self._get_info()
10+ return self._info.get('public_key')
11+
12+ @property
13 def members(self):
14 url = 'lists/{0}/roster/member'.format(self.fqdn_listname)
15 response, content = self._connection.call(url)
16@@ -427,6 +432,14 @@
17 entries.append(request)
18 return entries
19
20+ def signature_max_age(self):
21+ """Maximimum age of a signature allowed to be posted
22+ """
23+ response, content = self._connection.call(
24+ 'lists/{0}/requests_max_age'.format(self.fqdn_listname), None, 'GET')
25+
26+ return response
27+
28 def add_owner(self, address):
29 self.add_role('owner', address)
30
31@@ -536,6 +549,10 @@
32 response, content = self._connection.call(
33 'lists/{0}'.format(self.fqdn_listname), None, 'DELETE')
34
35+ def create_keys(self):
36+ """Generate the pgp-keys associated with the mailing list"""
37+ response, content = self._connection.call(
38+ 'lists/{0}/create_keys'.format(self.fqdn_listname), None, 'GET')
39
40 class _Member:
41 def __init__(self, connection, url):
42@@ -603,6 +620,7 @@
43 self._subscription_list_ids = None
44 self._preferences = None
45 self._cleartext_password = None
46+ self._key = None
47
48 def __repr__(self):
49 return '<User "{0}" ({1})>'.format(
50@@ -682,6 +700,19 @@
51 self._preferences = _Preferences(self._connection, path)
52 return self._preferences
53
54+ @property
55+ def key(self):
56+ response, content = self._connection.call(
57+ 'users/{0}/key'.format(self.user_id),
58+ method='GET')
59+ return content
60+
61+ def import_key(self, **kwargs):
62+ print kwargs
63+ response, content = self._connection.call(
64+ 'users/{0}/key'.format(self.user_id),
65+ kwargs, method='POST')
66+
67 def save(self):
68 data = {'display_name': self.display_name}
69 if self._cleartext_password is not None:
70@@ -789,7 +820,7 @@
71
72 def __setitem__(self, key, value):
73 self._preferences[key] = value
74-
75+
76 def __getitem__(self, key):
77 return self._preferences[key]
78
79@@ -822,8 +853,8 @@
80 'join_address', 'last_post_at', 'leave_address',
81 'list_id', 'list_name', 'next_digest_number',
82 'no_reply_address', 'owner_address', 'post_id',
83- 'posting_address', 'request_address', 'scheme',
84- 'volume', 'web_host',)
85+ 'posting_address', 'public_key', 'request_address',
86+ 'scheme', 'volume', 'web_host',)
87
88
89 class _Settings:

Subscribers

People subscribed via source and target branches