mailmanager 1.0.11 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog CHANGED
@@ -1,4 +1,7 @@
1
- Current version is 1.0.11
1
+ Current version is 1.0.12
2
+
3
+ changes since 1.0.11
4
+ - should now be compatible with Python 2.4+ (was 2.6+); 2.4 requires simplejson
2
5
 
3
6
  changes since 1.0.8
4
7
  - added more list metadata methods (see API docs)
data/Gemfile.lock CHANGED
@@ -40,6 +40,8 @@ PLATFORMS
40
40
 
41
41
  DEPENDENCIES
42
42
  ZenTest (~> 4.4.2)
43
+ json (~> 1.4.6)
43
44
  mailmanager!
45
+ open4 (~> 1.0.1)
44
46
  rspec (~> 2.4.0)
45
47
  ruby-debug19
@@ -1,6 +1,16 @@
1
- import json
1
+ try:
2
+ import json
3
+ except ImportError:
4
+ import simplejson as json
2
5
  from email.Utils import parseaddr
3
- from collections import Callable
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 isinstance(attr, Callable):
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 as err:
60
+ except TypeError, err:
51
61
  error_msg = '%s' % err
52
62
  print json.dumps({'error': error_msg})
53
- except AttributeError as err:
63
+ except AttributeError, err:
54
64
  error_msg = 'AttributeError: %s' % err
55
65
  print json.dumps({'error': error_msg})
56
- except Errors.MMSubscribeNeedsConfirmation as err:
66
+ except Errors.MMSubscribeNeedsConfirmation, err:
57
67
  print json.dumps({'result': 'pending_confirmation'})
58
- except Errors.MMAlreadyAMember as err:
68
+ except Errors.MMAlreadyAMember, err:
59
69
  print json.dumps({'result': 'already_a_member'})
60
- except Errors.MMNeedApproval as err:
70
+ except Errors.MMNeedApproval, err:
61
71
  print json.dumps({'result': 'needs_approval'})
62
- except Exception as err:
72
+ except Exception, err:
63
73
  error_msg = '%s: %s' % (type(err), err)
64
74
  print json.dumps({'error': error_msg})
65
75
  else:
@@ -1,3 +1,3 @@
1
1
  module MailManager
2
- VERSION = '1.0.11'
2
+ VERSION = '1.0.12'
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 11
9
- version: 1.0.11
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-25 00:00:00 -05:00
17
+ date: 2011-01-26 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency