home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import sys
- import cherrypy
-
- def process_body():
-
- try:
- import xmlrpclib
- return xmlrpclib.loads(cherrypy.request.body.read())
- except Exception:
- return (('ERROR PARAMS',), 'ERRORMETHOD')
-
-
-
- def patched_path(path):
- if not path.endswith('/'):
- path += '/'
-
- if path.startswith('/RPC2/'):
- path = path[5:]
-
- return path
-
-
- def _set_response(body):
- response = cherrypy.response
- response.status = '200 OK'
- response.body = body
- response.headers['Content-Type'] = 'text/xml'
- response.headers['Content-Length'] = len(body)
-
-
- def respond(body, encoding = 'utf-8', allow_none = 0):
- import xmlrpclib
- if not isinstance(body, xmlrpclib.Fault):
- body = (body,)
-
- _set_response(xmlrpclib.dumps(body, methodresponse = 1, encoding = encoding, allow_none = allow_none))
-
-
- def on_error(*args, **kwargs):
- body = str(sys.exc_info()[1])
- import xmlrpclib
- _set_response(xmlrpclib.dumps(xmlrpclib.Fault(1, body)))
-
-