관리-도구
편집 파일: xmlrpc_curl.cpython-38.pyc
U (?�f� � @ s^ zd dl Z d dl mZmZ W n ek r0 Y nX e � ee� zd dlmZ W nF ek r� zd dlmZ W n ek r� d dlmZ Y nX Y nX zd dlZW n ek r� d dlm Z Y nX d dl Z d dlZejd dkZ G dd� dej�Zedk�rZejde� d �Zee� zeej�d �� W n. ejk �rX e�� d Zede� Y nX dS ) � N)�SIGPIPE�SIG_IGN)�StringIO� c @ s* e Zd ZdZdgZd dd�Zd dd�ZdS )� CURLTransportz5Handles a cURL HTTP transaction to an XML-RPC server.zContent-Type: text/xmlNc C s~ t �� | _| j�t jd� | j�t jd� | j�t jd� | j�t j| j� |d krt|d krt| j�t j d||f � d| _ d S )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__r c C s� t � }| j�tjd||f � | j�tj|� | j�tj|j� | j�tj|� || _ z| j� � W nH tjk r� t� � d }tr�|j}t�|| |d |d d ��Y nX |�d� | �|�S )Nzhttp://%s%sr r )r r r r �URLZ POSTFIELDSZ WRITEFUNCTION�write�VERBOSE�verboseZperform�error�sys�exc_info�PY3�args� xmlrpclib� ProtocolError�seek�parse_response)r �host�handler�request_bodyr �b�vr r r �request/ s( � zCURLTransport.request)NN)r )�__name__� __module__�__qualname__�__doc__r r r'