Your IP : 3.15.211.55


Current Path : /opt/hc_python/share/doc/pycurl/examples/__pycache__/
Upload File :
Current File : //opt/hc_python/share/doc/pycurl/examples/__pycache__/xmlrpc_curl.cpython-38.pyc

U

hf��@s^zddlZddlmZmZWnek
r0YnXe�ee�zddlmZWnFek
r�zddlmZWn ek
r�ddlmZYnXYnXzddlZWn ek
r�ddlm	ZYnXddl
Z
ddlZejddkZ
Gdd�dej�Zedk�rZejde�d	�Zee�zeej�d
��Wn.ejk
�rXe��dZede�YnXdS)
�N)�SIGPIPE�SIG_IGN)�StringIO�c@s*eZdZdZdgZd	dd�Zd
dd�ZdS)�
CURLTransportz5Handles a cURL HTTP transaction to an XML-RPC server.zContent-Type: text/xmlNcCs~t��|_|j�tjd�|j�tjd�|j�tjd�|j�tj|j�|dkrt|dkrt|j�tj	d||f�d|_
dS)N��z%s:%sF)�pycurlZCurl�c�setopt�POSTZNOSIGNALZCONNECTTIMEOUTZ
HTTPHEADER�xmlrpc_hZUSERPWD�
_use_datetime)�self�username�password�r�^/opt/hc_python/lib64/python3.8/site-packages/../../../share/doc/pycurl/examples/xmlrpc_curl.py�__init__%s
zCURLTransport.__init__rc	Cs�t�}|j�tjd||f�|j�tj|�|j�tj|j�|j�tj|�||_	z|j�
�WnHtjk
r�t�
�d}tr�|j}t�|||d|dd��YnX|�d�|�|�S)Nzhttp://%s%srr)rr
rr	�URLZ
POSTFIELDSZ
WRITEFUNCTION�write�VERBOSE�verboseZperform�error�sys�exc_info�PY3�args�	xmlrpclib�
ProtocolError�seek�parse_response)r�host�handler�request_bodyr�b�vrrr�request/s(�

zCURLTransport.request)NN)r)�__name__�
__module__�__qualname__�__doc__r
rr'rrrrr s

r�__main__zhttp://betty.userland.com)�	transport�)r�ERROR)�signalrr�ImportError�	cStringIOr�ior�
xmlrpc.client�clientr	r�version_infor�	Transportrr(�ServerProxy�server�printZexamplesZgetStateName�Errorrr&rrrr�<module>s<$
�

?>