mailmanager 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Changelog +4 -1
- data/Gemfile.lock +2 -0
- data/lib/mailmanager/listproxy.py +19 -9
- data/lib/mailmanager/version.rb +1 -1
- metadata +3 -3
data/Changelog
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
-
|
1
|
+
try:
|
2
|
+
import json
|
3
|
+
except ImportError:
|
4
|
+
import simplejson as json
|
2
5
|
from email.Utils import parseaddr
|
3
|
-
|
6
|
+
try:
|
7
|
+
from collections import Callable
|
8
|
+
except ImportError:
|
9
|
+
def iscallable(attr):
|
10
|
+
return callable(attr)
|
11
|
+
else:
|
12
|
+
def iscallable(attr):
|
13
|
+
return isinstance(attr, Callable)
|
4
14
|
from Mailman import MailList
|
5
15
|
from Mailman import Errors
|
6
16
|
|
@@ -22,7 +32,7 @@ def userdesc_for(member):
|
|
22
32
|
def unwindattrs(obj, attrs, *args):
|
23
33
|
if not attrs.count('.'):
|
24
34
|
attr = getattr(obj, attrs)
|
25
|
-
if
|
35
|
+
if iscallable(attr):
|
26
36
|
return attr(*args)
|
27
37
|
else:
|
28
38
|
return attr
|
@@ -47,19 +57,19 @@ def command(mlist, cmd, *args):
|
|
47
57
|
result['return'] = unwindattrs(mlist, cmd, *args)
|
48
58
|
if needs_save.get(cmd.replace('.','_'), False):
|
49
59
|
mlist.Save()
|
50
|
-
except TypeError
|
60
|
+
except TypeError, err:
|
51
61
|
error_msg = '%s' % err
|
52
62
|
print json.dumps({'error': error_msg})
|
53
|
-
except AttributeError
|
63
|
+
except AttributeError, err:
|
54
64
|
error_msg = 'AttributeError: %s' % err
|
55
65
|
print json.dumps({'error': error_msg})
|
56
|
-
except Errors.MMSubscribeNeedsConfirmation
|
66
|
+
except Errors.MMSubscribeNeedsConfirmation, err:
|
57
67
|
print json.dumps({'result': 'pending_confirmation'})
|
58
|
-
except Errors.MMAlreadyAMember
|
68
|
+
except Errors.MMAlreadyAMember, err:
|
59
69
|
print json.dumps({'result': 'already_a_member'})
|
60
|
-
except Errors.MMNeedApproval
|
70
|
+
except Errors.MMNeedApproval, err:
|
61
71
|
print json.dumps({'result': 'needs_approval'})
|
62
|
-
except Exception
|
72
|
+
except Exception, err:
|
63
73
|
error_msg = '%s: %s' % (type(err), err)
|
64
74
|
print json.dumps({'error': error_msg})
|
65
75
|
else:
|
data/lib/mailmanager/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 12
|
9
|
+
version: 1.0.12
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Wes Morgan
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-26 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|