mainqndtest
v1.1.1
Last change
on this file since 42095c5 was
42bd667,
checked in by David Fuertes <dfuertes@…>, 4 years ago
|
Historial Limpio
|
-
Property mode set to
100755
|
File size:
849 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | |
---|
4 | """ |
---|
5 | | This file is part of the web2py Web Framework |
---|
6 | | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> |
---|
7 | | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) |
---|
8 | """ |
---|
9 | |
---|
10 | from gluon._compat import PY2 |
---|
11 | |
---|
12 | if PY2: |
---|
13 | from SimpleXMLRPCServer import SimpleXMLRPCDispatcher |
---|
14 | else: |
---|
15 | from xmlrpc.server import SimpleXMLRPCDispatcher |
---|
16 | |
---|
17 | def handler(request, response, methods): |
---|
18 | response.session_id = None # no sessions for xmlrpc |
---|
19 | dispatcher = SimpleXMLRPCDispatcher(allow_none=True, encoding=None) |
---|
20 | for method in methods: |
---|
21 | dispatcher.register_function(method) |
---|
22 | dispatcher.register_introspection_functions() |
---|
23 | response.headers['Content-Type'] = 'text/xml' |
---|
24 | dispatch = getattr(dispatcher, '_dispatch', None) |
---|
25 | return dispatcher._marshaled_dispatch(request.body.read(), dispatch) |
---|
Note: See
TracBrowser
for help on using the repository browser.