diff options
| author | Sergey Schetinin <sergey@maluke.com> | 2011-06-30 17:52:23 +0300 |
|---|---|---|
| committer | Sergey Schetinin <sergey@maluke.com> | 2011-06-30 17:52:23 +0300 |
| commit | 700240d9366abfc5cecaab83dcaa5b3be4841938 (patch) | |
| tree | fa21984e7e2125b873a258c10021134e4f1fffda /docs/jsonrpc-example-code | |
| parent | 070a77c525720a930b3be831bb6b72af9068ea5d (diff) | |
| download | webob-700240d9366abfc5cecaab83dcaa5b3be4841938.tar.gz | |
drop python 2.4 compatibility
Diffstat (limited to 'docs/jsonrpc-example-code')
| -rw-r--r-- | docs/jsonrpc-example-code/jsonrpc.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/jsonrpc-example-code/jsonrpc.py b/docs/jsonrpc-example-code/jsonrpc.py index e2273b0..ccd3519 100644 --- a/docs/jsonrpc-example-code/jsonrpc.py +++ b/docs/jsonrpc-example-code/jsonrpc.py @@ -27,7 +27,7 @@ class JsonRpcApp(object): if not req.method == 'POST': raise exc.HTTPMethodNotAllowed( "Only POST allowed", - allowed='POST').exception + allowed='POST') try: json = loads(req.body) except ValueError, e: @@ -41,7 +41,7 @@ class JsonRpcApp(object): "JSON body missing parameter: %s" % e) if method.startswith('_'): raise exc.HTTPForbidden( - "Bad method name %s: must not start with _" % method).exception + "Bad method name %s: must not start with _" % method) if not isinstance(params, list): raise ValueError( "Bad params %r: must be a list" % params) @@ -89,7 +89,7 @@ class ServerProxy(object): if name.startswith('_'): raise AttributeError(name) return _Method(self, name) - + def __repr__(self): return '<%s for %s>' % ( self.__class__.__name__, self._url) @@ -188,6 +188,6 @@ def main(args=None): print 'Serving on http://%s:%s' % (options.host, options.port) server.serve_forever() # Try python jsonrpc.py 'jsonrpc:DemoObject()' - + if __name__ == '__main__': main() |
