ó
Xé?_c           @   sh   d  d l  Z  d  d l Z d  d l m Z d „  Z d „  Z d „  Z d „  Z d d d	 „ Z d
 „  Z	 d S(   iÿÿÿÿN(   t   ntobc          C   s7   y d d  l  j }  Wn t k
 r2 d d  l }  n X|  S(   Niÿÿÿÿ(   t   xmlrpc.clientt   clientt   ImportErrort	   xmlrpclib(   t   x(    (    s~   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/xmlrpcutil.pyt   get_xmlrpclib   s
    c           C   s9   y  t  ƒ  j t j j j ƒ  ƒ SWn t k
 r4 d SXd S(   s*   Return (params, method) from request body.s   ERROR PARAMSt   ERRORMETHODN(   s   ERROR PARAMS(   (   s   ERROR PARAMSR   (   R   t   loadst   cherrypyt   requestt   bodyt   readt	   Exception(    (    (    s~   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/xmlrpcutil.pyt   process_body   s     c         C   s<   |  j  d ƒ s |  d 7}  n  |  j d ƒ r8 |  d }  n  |  S(   s    Return 'path', doctored for RPC.t   /s   /RPC2/i   (   t   endswitht
   startswith(   t   path(    (    s~   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/xmlrpcutil.pyt   patched_path   s
    c         C   sH   t  j } d | _ t |  d ƒ | _ d | j d <t |  ƒ | j d <d  S(   Ns   200 OKs   utf-8s   text/xmls   Content-Types   Content-Length(   R	   t   responset   statusR    R   t   headerst   len(   R   R   (    (    s~   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/xmlrpcutil.pyt   _set_response!   s
    		s   utf-8i    c      	   C   sP   t  ƒ  } t |  | j ƒ s' |  f }  n  t | j |  d d d | d | ƒƒ d  S(   Nt   methodresponsei   t   encodingt
   allow_none(   R   t
   isinstancet   FaultR   t   dumps(   R   R   R   R   (    (    s~   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/xmlrpcutil.pyt   respond-   s    	c          O   sB   t  t j ƒ  d ƒ } t ƒ  } t | j | j d | ƒ ƒ ƒ d  S(   Ni   (   t   strt   syst   exc_infoR   R   R   R   (   t   argst   kwargsR   R   (    (    s~   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/xmlrpcutil.pyt   on_error6   s    	(
   R!   R	   t   cherrypy._cpcompatR    R   R   R   R   R   R%   (    (    (    s~   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/xmlrpcutil.pyt   <module>   s   			
		