HEX
Server: LiteSpeed
System: Linux server334.web-hosting.com 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User: richfield (1256)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/rhn/__pycache__/rpclib.cpython-36.pyc
3

�Z�ik�@shdZddljZddlmZmZmZmZddl	m
Z
Gdd�de�ZGdd�dej
�Zd	d
�Zdd�ZdS)
z13.0.3-1.module_el8.10.0+7020+fd2ced8d.cloudlinux-�N)�urlparse�
urlunparse�	splittype�	splithost)�
transportsc@seZdZdS)�MalformedURIErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib/python3.6/rpclib.pyr srcsReZdZdZd�fdd�	Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
�ZS)�Servera	uri [,options] -> a logical connection to an XML-RPC server

    uri is the connection point on the server, given as
    scheme://host/target.

    If the target part and the slash preceding it are both omitted,
    "/RPC2" is assumed.

    The following options can be given as keyword arguments:

        transport: a transport factory
        verbose: verbosity level
        proxy: use an HTTP proxy
        username: username for authenticated HTTP proxy
        password: password for authenticated HTTP proxy

    Nrc	sN|jd�}|dkr.tj|||j||||�d�}|j|�t�j|||d�dS)N�https)�	use_https�timeout�proxy)�verbose)�
startswithrZRequestsTransport�
get_proxy_uri�_reset_host_handler_and_type�super�__init__)	�self�uriZ	transportrrZusernameZpasswordrr)�	__class__rrr7s

zServer.__init__cCs�|dkrdStd|�}d}|dk	r(|}|r@|dk	r@|d|}|rZ|j|d|jd�}|rl|jdd�}n|jdd�}t|�S)Nzhttp://�:�@)�netlocr)�scheme�http)r�_replacerr)rZ
proxy_hostZ
proxy_userZ
proxy_passr�partsZauth_stringrrrrGszServer.get_proxy_uricCsxt|�\}}|dkrtd��t|�dks8|dd�dkr<t�|j�|_|jdkrXtd	��t|�\|_|_|jstd
|_dS)z�
        Reset the attributes:
        self._host, self._handler, self._type
        according the value of self._uri.

        Kept for backwards compatibility.
        Nzmissing protocol in uri�r�z//rrzunsupported XML-RPC protocolz/RPC2)rr)	rr�len�lowerZ_type�IOErrorrZ_hostZ_handler)rr�typerrrr^s	

z#Server._reset_host_handler_and_typecCs|jj||�S)N)�_ServerProxy__transport�
set_header)r�name�argrrrr)uszServer.set_headercCs|jj||�S)N)r(�
add_header)rr*r+rrrr,xszServer.add_headercCs
|jj�S)N)r(�
clear_headers)rrrrr-{szServer.clear_headerscCs|jj|�dS)N)r(�set_trusted_cert)rZcertfilerrrr.~szServer.set_trusted_cert)NrNNNN)rr	r
�__doc__rrrr)r,r-r.�
__classcell__rr)rrr
$sr
cCs>ddl}t||j�s*||kr&||gSgSdd�|j|�D�S)NrcSs g|]}|jdd�dj��qS)r�)�split�strip)�.0�xrrr�
<listcomp>�sz#getHeaderValues.<locals>.<listcomp>)�	mimetools�
isinstanceZMessageZgetallmatchingheaders)�headersr*r7rrr�getHeaderValues�s
r:cCsbd}d}d}||kr t||�}d}||krZt||�}|rZdj|�}ddl}d|j|�}||fS)z% Reports the error from the headers. r�zX-RHN-Fault-CodezX-RHN-Fault-StringNz%s)�intr:�join�base64Zdecodestring)r9Zerrcode�errmsg�sZ_sListZ_sr>rrr�reportError�s

rA)�__version__Z
xmlrpc.clientZclientZ	xmlrpclibZurllib.parserrrrZrhnrr&rZServerProxyr
r:rArrrr�<module>s
^