Mercurial > p > roundup > code
comparison roundup/xmlrpc.py @ 5012:6b7f257e5de8
Simplify SimpleXMLRPCDispatcher initialisation
Support for Python v2.4 has been dropped a while ago so we can remove
the compatibility support for initialising SimpleXMLRPCDispatcher with
version of Python older than v2.5
| author | John Kristensen <john@jerrykan.com> |
|---|---|
| date | Thu, 13 Aug 2015 14:45:53 +1000 |
| parents | d9e5539303bd |
| children | 1c792cf0a574 |
comparison
equal
deleted
inserted
replaced
| 5011:d5da643b3d25 | 5012:6b7f257e5de8 |
|---|---|
| 188 """RoundupDispatcher bridges from cgi.client to RoundupInstance. | 188 """RoundupDispatcher bridges from cgi.client to RoundupInstance. |
| 189 It expects user authentication to be done.""" | 189 It expects user authentication to be done.""" |
| 190 | 190 |
| 191 def __init__(self, db, actions, translator, | 191 def __init__(self, db, actions, translator, |
| 192 allow_none=False, encoding=None): | 192 allow_none=False, encoding=None): |
| 193 | 193 SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding) |
| 194 try: | |
| 195 # python2.5 and beyond | |
| 196 SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding) | |
| 197 except TypeError: | |
| 198 # python2.4 | |
| 199 SimpleXMLRPCDispatcher.__init__(self) | |
| 200 self.register_instance(RoundupInstance(db, actions, translator)) | 194 self.register_instance(RoundupInstance(db, actions, translator)) |
| 201 self.register_multicall_functions() | 195 self.register_multicall_functions() |
| 202 | 196 |
| 203 | 197 |
| 204 def dispatch(self, input): | 198 def dispatch(self, input): |
