AlkantarClanX12

Your IP : 18.191.237.228


Current Path : /proc/self/root/opt/alt/python311/lib64/python3.11/xmlrpc/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python311/lib64/python3.11/xmlrpc/__pycache__/client.cpython-311.pyc

�

c��f���B�dZddlZddlZddlZddlmZddlmZddlZddl	Z
ddlmZddl
Z
ddlmZ	ddlZn
#e$rdZYnwxYwd�Zdejdd	�zZd
ZdZdZd
ZdZdZdZdZdZdZd
ZdZ dZ!dZ"Gd�de#��Z$Gd�de$��Z%Gd�de$��Z&Gd�de$��Z'e(xZ)Z*eddd��Z+d�Z,e,d ��rd!�Z-ne,d"��rd#�Z-nd$�Z-[+[,d%�Z.Gd&�d'��Z/d(�Z0d)�Z1Gd*�d+��Z2d,�Z3e/e2fZ4Gd-�d.��Z5Gd/�d0��Z6Gd1�d2��Z7Gd3�d4��Z8Gd5�d6��Z9Gd7�d8��Z:dxZ;xZ<Z=dNd:�Z>		dOd;�Z?dNd<�Z@d=�ZAdPd?�ZBGd@�dAerejCneD��ZEGdB�dC��ZFGdD�dE��ZGGdF�dGeG��ZHGdH�dI��ZIeIZJeKdJkr�eIdK��ZL	eMeLjN�O����n#e$$rZPeMdLeP��YdZP[PndZP[PwwxYwe:eL��ZQeQ�R��eQ�Sd	dM��eQ�Tdd	��	eQ��D]
ZUeMeU���dS#e$$rZPeMdLeP��YdZP[PdSdZP[PwwxYwdS)Qa�
An XML-RPC client interface for Python.

The marshalling and response parser code can also be used to
implement XML-RPC servers.

Exported exceptions:

  Error          Base class for client errors
  ProtocolError  Indicates an HTTP protocol error
  ResponseError  Indicates a broken response package
  Fault          Indicates an XML-RPC fault package

Exported classes:

  ServerProxy    Represents a logical connection to an XML-RPC server

  MultiCall      Executor of boxcared xmlrpc requests
  DateTime       dateTime wrapper for an ISO 8601 string or time tuple or
                 localtime integer value to generate a "dateTime.iso8601"
                 XML-RPC value
  Binary         binary data wrapper

  Marshaller     Generate an XML-RPC params chunk from a Python data structure
  Unmarshaller   Unmarshal an XML-RPC response from incoming XML event message
  Transport      Handles an HTTP transaction to an XML-RPC server
  SafeTransport  Handles an HTTPS transaction to an XML-RPC server

Exported constants:

  (none)

Exported functions:

  getparser      Create instance of the fastest available parser & attach
                 to an unmarshalling object
  dumps          Convert an argument tuple or a Fault instance to an XML-RPC
                 request (or response, if the methodresponse option is used).
  loads          Convert an XML-RPC packet to unmarshalled data plus a method
                 name (None if not present).
�N)�datetime)�Decimal)�expat)�BytesIOc��|�dd��}|�dd��}|�dd��S)N�&z&amp;�<z&lt;�>z&gt;)�replace)�ss �4/opt/alt/python311/lib64/python3.11/xmlrpc/client.py�escaper�s<��	�	�	�#�w���A�	�	�	�#�v���A��9�9�S�&�"�"�"�z%d.%d�i���i�iD���i����i���ip���iԁ��iC���iB���i����i����i����c� �eZdZdZejZdS)�ErrorzBase class for client errors.N)�__name__�
__module__�__qualname__�__doc__�object�__str__�rr
rr�s������'�'��n�G�G�Grrc��eZdZdZd�Zd�ZdS)�
ProtocolErrorz!Indicates an HTTP protocol error.c�r�t�|��||_||_||_||_dS�N)r�__init__�url�errcode�errmsg�headers)�selfrr r!r"s     r
rzProtocolError.__init__�s4��
���t�����������������rc	�R�d|jj�d|j�d|j�d|j�d�	S)Nr	� for �: � r
)�	__class__rrr r!�r#s r
�__repr__zProtocolError.__repr__�s7����^�
$�
$�
$�d�h�h�h�����d�k�k�k�
K�	rN�rrrrrr*rrr
rr�s8������+�+��������rrc��eZdZdZdS)�
ResponseErrorz$Indicates a broken response package.N)rrrrrrr
r-r-�s������.�.��Drr-c��eZdZdZd�Zd�ZdS)�Faultz#Indicates an XML-RPC fault package.c�V�t�|��||_||_dSr)rr�	faultCode�faultString)r#r1r2�extras    r
rzFault.__init__�s)��
���t����"���&����rc�B�d|jj�d|j�d|j�d�S)Nr	r'r&r
)r(rr1r2r)s r
r*zFault.__repr__�s2��� $�� 7� 7� 7� $�����0@�0@�0@�B�	BrNr+rrr
r/r/�s=������-�-�'�'�'�B�B�B�B�Brr/�c�b�	t�|��dkS#t$rYdSwxYw)N�0001F)�_day0�strftime�
ValueError)�fmts r
�_tryr<s@����~�~�c�"�"�f�,�,�������u�u����s� �
.�.z%Yc�,�|�d��S�N�%Y%m%dT%H:%M:%S�r9��values r
�_iso8601_formatrCs���~�~�/�0�0�0rz%4Yc�,�|�d��S)Nz%4Y%m%dT%H:%M:%Sr@rAs r
rCrCs���~�~�0�1�1�1rc�R�|�d���d��S)Nr?�)r9�zfillrAs r
rCrCs#���~�~�/�0�0�6�6�r�:�:�:rc��t|t��rt|��St|ttjf��s-|dkrt	j��}t	j|��}d|dd�zS)Nrz%04d%02d%02dT%02d:%02d:%02d�)�
isinstancerrC�tuple�time�struct_time�	localtimerAs r
�	_strftimerOsr���%��"�"�&��u�%�%�%��e�e�T�%5�6�7�7�&��A�:�:��I�K�K�E���u�%�%��(�5��!��9�4�4rc�\�eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�ZdS)�DateTimez�DateTime wrapper for an ISO 8601 string or time tuple or
    localtime integer value to generate 'dateTime.iso8601' XML-RPC
    value.
    rc�j�t|t��r	||_dSt|��|_dSr)rJ�strrBrO)r#rBs  r
rzDateTime.__init__.s2���e�S�!�!�	*��D�J�J�J�"�5�)�)�D�J�J�Jrc�l�t|t��r|j}|j}n�t|t��r|j}t	|��}nat|t
��r
|j}|}nBt
|d��r)|���}|���}n	|}t}||fS)N�	timetuple)	rJrQrBrrCrS�hasattrrU�NotImplemented�r#�otherr�os    r
�make_comparablezDateTime.make_comparable4s����e�X�&�&�	��
�A���A�A�
��x�
(�
(�	��
�A���&�&�A�A�
��s�
#�
#�	��
�A��A�A�
�U�K�
(�
(�	���� � �A����!�!�A�A��A��A��!�t�rc�^�|�|��\}}|turtS||kSr�r[rWrXs    r
�__lt__zDateTime.__lt__F�3���#�#�E�*�*���1�����!�!��1�u�rc�^�|�|��\}}|turtS||kSrr]rXs    r
�__le__zDateTime.__le__L�3���#�#�E�*�*���1�����!�!��A�v�
rc�^�|�|��\}}|turtS||kSrr]rXs    r
�__gt__zDateTime.__gt__Rr_rc�^�|�|��\}}|turtS||kSrr]rXs    r
�__ge__zDateTime.__ge__Xrbrc�^�|�|��\}}|turtS||kSrr]rXs    r
�__eq__zDateTime.__eq__^rbrc�6�tj|jd��Sr>)rL�strptimerBr)s r
rUzDateTime.timetupleds���}�T�Z�):�;�;�;rc��|jSrrAr)s r
rzDateTime.__str__ls
���z�rc�J�d|jj|jt|��fzS)Nz<%s %r at %#x>)r(rrB�idr)s r
r*zDateTime.__repr__os!���4�>�#:�D�J��4���"Q�Q�Qrc�R�t|�����|_dSr)rS�striprB�r#�datas  r
�decodezDateTime.decoders����Y�Y�_�_�&�&��
�
�
rc��|�d��|�|j��|�d��dS�Nz<value><dateTime.iso8601>z</dateTime.iso8601></value>
)�writerB)r#�outs  r
�encodezDateTime.encodeusB���	�	�-�.�.�.��	�	�$�*�����	�	�1�2�2�2�2�2rN)r)rrrrrr[r^rardrfrhrUrr*rrrwrrr
rQrQ(s���������
*�*�*�*����$���������������<�<�<����R�R�R�'�'�'�3�3�3�3�3rrQc�L�t��}|�|��|Sr)rQrr�rqrBs  r
�	_datetimerzzs"���J�J�E�	�L�L������Lrc�,�tj|d��Sr>)rrj)rqs r
�_datetime_typer|�s����T�#4�5�5�5rc�2�eZdZdZdd�Zd�Zd�Zd�Zd�ZdS)	�BinaryzWrapper for binary data.Nc��|�d}nGt|ttf��std|jjz���t|��}||_dS)Nrz#expected bytes or bytearray, not %s)rJ�bytes�	bytearray�	TypeErrorr(rrqrps  r
rzBinary.__init__�s]���<��D�D��d�U�I�$6�7�7�
9�� E� $�� 7�!8�9�9�9���;�;�D���	�	�	rc�,�t|jd��S)Nzlatin-1)rSrqr)s r
rzBinary.__str__�s���4�9�i�(�(�(rc�P�t|t��r|j}|j|kSr)rJr~rq)r#rYs  r
rhz
Binary.__eq__�s(���e�V�$�$�	��J�E��y�E�!�!rc�8�tj|��|_dSr)�base64�decodebytesrqrps  r
rrz
Binary.decode�s���&�t�,�,��	�	�	rc���|�d��tj|j��}|�|�d����|�d��dS�Nz<value><base64>
�asciiz</base64></value>
)rur��encodebytesrqrr)r#rv�encodeds   r
rwz
Binary.encode�s^���	�	�%�&�&�&��$�T�Y�/�/���	�	�'�.�.��)�)�*�*�*��	�	�'�(�(�(�(�(rr)	rrrrrrrhrrrwrrr
r~r~�sj������"�"�����)�)�)�"�"�"�
-�-�-�)�)�)�)�)rr~c�L�t��}|�|��|Sr)r~rrrys  r
�_binaryr��s"���H�H�E�	�L�L������Lrc� �eZdZd�Zd�Zd�ZdS)�ExpatParserc���tjdd��x|_}||_|j|_|j|_|j|_	d}|�
|d��dSr)r�ParserCreate�_parser�_target�start�StartElementHandler�end�EndElementHandlerrq�CharacterDataHandler�xml)r#�target�parser�encodings    r
rzExpatParser.__init__�s_�� %� 2�4�� >� >�>���v����%+�\��"�#)�:�� �&,�k��#����
�
�8�T�"�"�"�"�"rc�<�|j�|d��dS�NF)r��Parserps  r
�feedzExpatParser.feed�s ������4��'�'�'�'�'rc�l�	|j}|`|`|�dd��dS#t$rYdSwxYw)NrT)r�r�r��AttributeError)r#r�s  r
�closezExpatParser.close�sW��	$��\�F���d�l��L�L��d�#�#�#�#�#��	�	�	�	��D�D�	���s�%�
3�3N)rrrrr�r�rrr
r�r��sA������#�#�#�(�(�(�$�$�$�$�$rr�c��eZdZdZdd�ZiZd�Zd�Zd�Zeee	d��<d�Z
e
ee<d	�Zeee
<eZd
�Zeee<efd�Zeee<d�Zeee<eee<d
�Zeee<eee<efd�Zeee<d�Zeee<d�Zeee<eee <eed<dS)�
MarshalleravGenerate an XML-RPC params chunk from a Python data structure.

    Create a Marshaller instance for each set of parameters, and use
    the "dumps" method to convert your data (represented as a tuple)
    to an XML-RPC params chunk.  To write a fault response, pass a
    Fault instance instead.  You may prefer to use the "dumps" module
    function for this purpose.
    NFc�>�i|_d|_||_||_dSr)�memorqr��
allow_none)r#r�r�s   r
rzMarshaller.__init__�s"����	���	� ��
�$����rc�T�g}|j}|j}t|t��r0|d��||j|jd�|��|d��n=|d��|D]$}|d��|||��|d���%|d��d�|��}|S)	Nz<fault>
)r1r2z	</fault>
z	<params>
z<param>
z	</param>
z
</params>
�)�append�_Marshaller__dumprJr/r1r2�join)r#�valuesrvru�dump�v�results       r
�dumpszMarshaller.dumps�s������
���{���f�e�$�$�	!��E�+�����D�v�/�!'�!3�5�5��
�
�
�
�E�,�����
�E�,�����
$�
$����k�"�"�"���Q�������l�#�#�#�#��E�-� � � ���������
rc��	|jt|��}n�#t$r�t|d��st	dt|��z���t|��jD]<}||j���vrt	dt|��z����=|jd}YnwxYw||||��dS)N�__dict__zcannot marshal %s objects�_arbitrary_instance)�dispatch�type�KeyErrorrVr��__mro__�keys)r#rBru�f�type_s     r
�__dumpzMarshaller.__dumps���	5��
�d�5�k�k�*�A�A���	5�	5�	5��5�*�-�-�
K�� ;�d�5�k�k� I�J�J�J��e���,�
O�
O���D�M�.�.�0�0�0�0�#�$?�$�u�+�+�$M�N�N�N�1��
�3�4�A�A�A�	5����	
��$��u�����s��BB7�6B7c�H�|jstd���|d��dS)Nz0cannot marshal None unless allow_none is enabledz<value><nil/></value>)r�r��r#rBrus   r
�dump_nilzMarshaller.dump_nils3����	P��N�O�O�O�
��%�&�&�&�&�&rc�P�|d��||rdpd��|d��dS)Nz<value><boolean>�1�0z</boolean></value>
rr�s   r
�	dump_boolzMarshaller.dump_bool sC��
�� �!�!�!�
��e�m��"�s�#�#�#�
��$�%�%�%�%�%rc���|tks|tkrtd���|d��|tt	|������|d��dS)Nzint exceeds XML-RPC limitsz<value><int>z</int></value>
)�MAXINT�MININT�
OverflowErrorrS�intr�s   r
�	dump_longzMarshaller.dump_long&se���6�>�>�U�V�^�^�� <�=�=�=�
��n����
��c�#�e�*�*�o�o����
�� �!�!�!�!�!rc�b�|d��|t|����|d��dS)Nz<value><double>z</double></value>
)�reprr�s   r
�dump_doublezMarshaller.dump_double1s@��
��� � � �
��d�5�k�k����
��#�$�$�$�$�$rc�Z�|d��|||����|d��dS)Nz<value><string>z</string></value>
r)r#rBrurs    r
�dump_unicodezMarshaller.dump_unicode7sB��
��� � � �
��f�f�U�m�m����
��#�$�$�$�$�$rc��|d��tj|��}||�d����|d��dSr�)r�r�rr)r#rBrur�s    r
�
dump_byteszMarshaller.dump_bytes=sV��
��!�"�"�"��$�U�+�+��
��g�n�n�W�%�%�&�&�&�
��#�$�$�$�$�$rc���t|��}||jvrtd���d|j|<|j}|d��|D]}|||���|d��|j|=dS)Nz"cannot marshal recursive sequencesz<value><array><data>
z</data></array></value>
)rmr�r�r�)r#rBru�ir�r�s      r
�
dump_arrayzMarshaller.dump_arrayEs����u�I�I����	�>�>��@�A�A�A���	�!���{��
��&�'�'�'��	�	�A��D��E�N�N�N�N�
��)�*�*�*��I�a�L�L�Lrc��t|��}||jvrtd���d|j|<|j}|d��|���D]b\}}|d��t|t��std���|d||��z��|||��|d���c|d��|j|=dS)Nz%cannot marshal recursive dictionariesz<value><struct>
z	<member>
zdictionary key must be stringz<name>%s</name>
z
</member>
z</struct></value>
)rmr�r�r��itemsrJrS)r#rBrurr�r��kr�s        r
�dump_structzMarshaller.dump_structSs����u�I�I����	�>�>��C�D�D�D���	�!���{��
��!�"�"�"��K�K�M�M�	!�	!�D�A�q��E�,�����a��%�%�
A�� ?�@�@�@��E�%���q�	�	�1�2�2�2��D��E�N�N�N��E�-� � � � �
��#�$�$�$��I�a�L�L�Lrc�b�|d��|t|����|d��dSrt)rOr�s   r
�
dump_datetimezMarshaller.dump_datetimeesB��
��)�*�*�*�
��i�������
��-�.�.�.�.�.rc��|jtvr ||_|�|��|`dS|�|j|��dSr)r(�WRAPPERSrurwr�r�r�s   r
�
dump_instancezMarshaller.dump_instanceksQ���?�h�&�&��D�J��L�L������
�
�
�
���U�^�U�3�3�3�3�3rr�r�)!rrrrrr�r�r�r�r�r��boolr�r��dump_intr��floatrr�rSr�r�r�r�rK�listr��dictr�rr�rQr~rrr
r�r��s���������%�%�%�%��H����6���$'�'�'�$�H�T�T�$�Z�Z��&�&�&��H�T�N�"�"�"��H�S�M��H�%�%�%�"�H�U�O�06�%�%�%�%�!�H�S�M�%�%�%�
!�H�U�O�$�H�Y��
�
�
�!�H�U�O��H�T�N�/5����� !�H�T�N�/�/�/�'�H�X��4�4�4�'�H�X��$�H�V��'4�H�
"�#�#�#rr�c�n�eZdZdZd/d�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�ZiZd�Z
e
ed<d
�Zeed<d�Zeed<eed<eed<eed<eed<eed<d�Zeed<eed<d�Zeed<d�Zeed<eed<d�Zeed<d �Zeed!<d"�Zeed#<d$�Zeed%<d&�Zeed'<d(�Zeed)<d*�Zeed+<d,�Zeed-<d.S)0�UnmarshalleraUnmarshal an XML-RPC response, based on incoming XML event
    messages (start, data, end).  Call close() to get the resulting
    data structure.

    Note that this reader is fairly tolerant, and gladly accepts bogus
    XML-RPC data without complaining (but not bogus XML).
    Fc��d|_g|_g|_g|_d|_d|_d|_|jj|_|p||_||_	dS)NF�utf-8)
�_type�_stack�_marks�_data�_value�_methodname�	_encodingr��
_use_datetime�
_use_bytes)r#�use_datetime�use_builtin_typess   r
rzUnmarshaller.__init__�sX����
���������
������� ����k�(���.�>�,���+����rc��|j�|jrt���|jdkrtdi|jd���t|j��S)N�faultrr)r�r�r-r/r�rKr)s r
r�zUnmarshaller.close�sR���:������/�/�!��:�� � ��)�)�$�+�a�.�)�)�)��T�[�!�!�!rc��|jSr)r�r)s r
�
getmethodnamezUnmarshaller.getmethodname�s����rc��||_dSr)r�)r#r��
standalones   r
r�zUnmarshaller.xml�s
��!����rc��d|vr|�d��d}|dks|dkr,|j�t|j����g|_|jr||jvrtd|z���|dk|_dS)N�:����array�structzunknown tag %rrB)	�splitr�r��lenr�r�r�r�r-)r#�tag�attrss   r
r�zUnmarshaller.start�s����#�:�:��)�)�C�.�.��$�C��'�>�>�S�H�_�_��K���s�4�;�/�/�0�0�0���
��;�	8�3�d�m�3�3�� 0�3� 6�7�7�7��g�~����rc�:�|j�|��dSr)r�r�)r#�texts  r
rqzUnmarshaller.data�s���
���$�����rc�
�	|j|}nQ#t$rDd|vrYdS	|j|�d��d}n#t$rYYdSwxYwYnwxYw||d�|j����S)Nr�r�r�)r�r�r�r�r�)r#rr�s   r
r�zUnmarshaller.end�s���	��
�c�"�A�A���	�	�	��#�~�~����
��M�#�)�)�C�.�.��"4�5�����
�
�
�����
������		�����q��r�w�w�t�z�*�*�+�+�+�2�
�A�&A	�A�	
A�A�A�A�Ac���	|j|}nQ#t$rDd|vrYdS	|j|�d��d}n#t$rYYdSwxYwYnwxYw|||��S)Nr�r�)r�r�r�)r#rrqr�s    r
�end_dispatchzUnmarshaller.end_dispatch�s���	��
�c�"�A�A���	�	�	��#�~�~����
��M�#�)�)�C�.�.��"4�5�����
�
�
�����
������		�����q��t�}�}�rc�>�|�d��d|_dS�Nr)r�r�rps  r
�end_nilzUnmarshaller.end_nil�s�����D��������r�nilc��|dkr|�d��n+|dkr|�d��ntd���d|_dS)Nr�Fr�Tzbad boolean valuer)r�r�r�rps  r
�end_booleanzUnmarshaller.end_boolean�sX���3�;�;��K�K������
�S�[�[��K�K�������/�0�0�0�����r�booleanc�X�|�t|����d|_dSr	)r�r�r�rps  r
�end_intzUnmarshaller.end_int�s%�����C��I�I��������r�i1�i2�i4�i8r��
bigintegerc�X�|�t|����d|_dSr	)r�r�r�rps  r
�
end_doublezUnmarshaller.end_double�s%�����E�$�K�K� � � �����r�doubler�c�X�|�t|����d|_dSr	)r�rr�rps  r
�end_bigdecimalzUnmarshaller.end_bigdecimal�s%�����G�D�M�M�"�"�"�����r�
bigdecimalc��|jr|�|j��}|�|��d|_dSr	)r�rrr�r�rps  r
�
end_stringzUnmarshaller.end_string�s<���>�	/��;�;�t�~�.�.�D����D��������r�string�namec�z�|j���}|j|d�g|j|d�<d|_dSr	)r��popr�r�)r#rq�marks   r
�	end_arrayzUnmarshaller.end_arrays<���{��� � ��"�k�$�%�%�0�1���D�E�E������rr�c���|j���}i}|j|d�}tdt	|��d��D]}||dz|||<�|g|j|d�<d|_dS)Nrrr5)r�r!r��ranger�r�)r#rqr"r�r�r�s      r
�
end_structzUnmarshaller.end_structs}���{��� � ������D�E�E�"���q�#�e�*�*�a�(�(�	(�	(�A�"�1�Q�3�Z�D��q��N�N�"�V���D�E�E������rr�c���t��}|�|�d����|jr|j}|�|��d|_dS)Nr�r)r~rrrwr�rqr�r��r#rqrBs   r
�
end_base64zUnmarshaller.end_base64sW������
���T�[�[��)�)�*�*�*��?�	��J�E����E��������rr�c��t��}|�|��|jrt|��}|�|��dSr)rQrrr�r|r�r(s   r
�end_dateTimezUnmarshaller.end_dateTime sM���
�
��
���T������	)�"�4�(�(�E����E�����rzdateTime.iso8601c�B�|jr|�|��dSdSr)r�rrps  r
�	end_valuezUnmarshaller.end_value(s0���;�	"��O�O�D�!�!�!�!�!�	"�	"rrBc��d|_dS)N�params�r�rps  r
�
end_paramszUnmarshaller.end_params/s
����
�
�
rr/c��d|_dS)Nr�r0rps  r
�	end_faultzUnmarshaller.end_fault3s
����
�
�
rr�c�d�|jr|�|j��}||_d|_dS)N�
methodName)r�rrr�r�rps  r
�end_methodNamezUnmarshaller.end_methodName7s2���>�	/��;�;�t�~�.�.�D����!��
�
�
rr5N�FF)rrrrrr�r�r�r�rqr�rr�r
r
rrrrr#r&r)r+r-r1r3r6rrr
r�r�sU��������
,�
,�
,�
,�"�"�"� � � �"�"�"�	'�	'�	'� � � �,�,�,� ��� �H�����H�U�O����&�H�Y������H�T�N��H�T�N��H�T�N��H�T�N��H�U�O�$�H�\�����$�H�X��"�H�W�����,�H�\�����
$�H�X��!�H�V�����
"�H�W�����$�H�X�����$�H�X�����$0�H�
� �"�"�"�
"�H�W�����#�H�X�����!�H�W��"�"�"�
,�H�\���rr�c� �eZdZd�Zd�Zd�ZdS)�_MultiCallMethodc�"�||_||_dSr)�_MultiCallMethod__call_list�_MultiCallMethod__name)r#�	call_listrs   r
rz_MultiCallMethod.__init__Ds��$�������rc�@�t|j|j�d|����S�N�.)r9r;r<�r#rs  r
�__getattr__z_MultiCallMethod.__getattr__Gs"���� 0�T�[�[�[�$�$�2O�P�P�Prc�H�|j�|j|f��dSr)r;r�r<�r#�argss  r
�__call__z_MultiCallMethod.__call__Is&��������d� 3�4�4�4�4�4rN�rrrrrBrFrrr
r9r9AsD���������Q�Q�Q�5�5�5�5�5rr9c��eZdZdZd�Zd�ZdS)�MultiCallIteratorzaIterates over the results of a multicall. Exceptions are
    raised in response to xmlrpc faults.c��||_dSr)�results)r#rKs  r
rzMultiCallIterator.__init__Ps
������rc��|j|}t|��ti��krt|d|d���t|��tg��kr|dStd���)Nr1r2rz#unexpected type in multicall result)rKr�r/r:)r#r��items   r
�__getitem__zMultiCallIterator.__getitem__Ssm���|�A�����:�:��b���!�!���[�)�4�
�+>�?�?�?�
�$�Z�Z�4��8�8�
#�
#���7�N��B�C�C�CrN)rrrrrrNrrr
rIrILsA������,�,����D�D�D�D�DrrIc�*�eZdZdZd�Zd�Zd�Zd�ZdS)�	MultiCalla~server -> an object used to boxcar method calls

    server should be a ServerProxy object.

    Methods can be added to the MultiCall using normal
    method call syntax e.g.:

    multicall = MultiCall(server_proxy)
    multicall.add(2,3)
    multicall.get_address("Guido")

    To execute the multicall, call the MultiCall object e.g.:

    add_result, address = multicall()
    c�"�||_g|_dSr)�_MultiCall__server�_MultiCall__call_list)r#�servers  r
rzMultiCall.__init__ms����
�����rc�>�d|jjt|��fzS)Nz<%s at %#x>)r(rrmr)s r
r*zMultiCall.__repr__qs����� 7��D���B�B�Brc�,�t|j|��Sr)r9rSrAs  r
rBzMultiCall.__getattr__ts���� 0�$�7�7�7rc��g}|jD]\}}|�||d����t|jj�|����S)N)r5r/)rSr�rIrR�system�	multicall)r#�marshalled_listrrEs    r
rFzMultiCall.__call__ws_�����*�	K�	K�J�D�$��"�"�4�D�#I�#I�J�J�J�J� ���!5�!?�!?��!P�!P�Q�Q�QrN)rrrrrr*rBrFrrr
rPrP\sb�������� ���C�C�C�8�8�8�R�R�R�R�RrrPFc�N�trdtr]|rt}tj}n|rt}t
}nt}t
}tdd||t��}t|��}n7t||���}trt|��}nt|��}||fS)z�getparser() -> parser, unmarshaller

    Create an instance of the fastest available parser, and attach it
    to an unmarshalling object.  Return both objects.
    TF�r�r�)
�
FastParser�FastUnmarshallerr|r�r�r�rzr/r�r�)r�r��
mkdatetime�mkbytesr�r�s      r
�	getparserra�s����)�&�)��	�'�J��(�G�G�
�	�'�J��G�G�"�J��G�!�$��w�
�E�J�J���F�#�#����<�K\�]�]�]���	)���'�'�F�F� ��(�(�F��6�>�rc���t|ttf��s
Jd���t|t��rd}n4|r2t|t��rt|��dks
Jd���|sd}trt	|��}nt||��}|�|��}|dkrdt|��z}nd}|r	|d|d|d	f}n|r|d
|df}n|Sd�|��S)
a�data [,options] -> marshalled data

    Convert an argument tuple or a Fault instance to an XML-RPC
    request (or response, if the methodresponse option is used).

    In addition to the data object, the following options can be given
    as keyword arguments:

        methodname: the method name for a methodCall packet

        methodresponse: true to create a methodResponse packet.
        If this option is used with a tuple, the tuple must be
        a singleton (i.e. it can contain only one element).

        encoding: the packet encoding (default is UTF-8)

    All byte strings in the data structure are assumed to use the
    packet encoding.  Unicode strings are automatically converted,
    where necessary.
    z(argument must be tuple or Fault instancer5z"response tuple must be a singletonr�z$<?xml version='1.0' encoding='%s'?>
z<?xml version='1.0'?>
z<methodCall>
<methodName>z</methodName>
z</methodCall>
z<methodResponse>
z</methodResponse>
r�)	rJrKr/r��FastMarshallerr�r�rSr�)r/�
methodname�methodresponser�r��mrq�	xmlheaders        r
r�r��sA��.�f�u�e�n�-�-�Y�Y�/Y�Y�Y�-��&�%� � �F����	�F�J�v�u�5�5�F��6�{�{�a����!E���������-��8�$�$����x��,�,���7�7�6�?�?�D��7���;�c�(�m�m�K�	�	�-�	���
�
�&�(9������
�	�
� ��!�	�����
�7�7�4�=�=�rc���t||���\}}|�|��|���|���|���fS)z�data -> unmarshalled data, method name

    Convert an XML-RPC packet to unmarshalled data plus a method
    name (None if not present).

    If the XML-RPC packet represents a fault condition, this function
    raises a Fault exception.
    r\)rar�r�r�)rqr�r��p�us     r
�loadsrk�sT���,�BS�T�T�T�D�A�q��F�F�4�L�L�L��G�G�I�I�I��7�7�9�9�a�o�o�'�'�'�'rc���tst�t��}tjd|d���5}|�|��ddd��n#1swxYwY|���S)zhdata -> gzip encoded data

    Encode data using the gzip content encoding as described in RFC 1952
    �wbr5)�mode�fileobj�
compresslevelN)�gzip�NotImplementedErrorr�GzipFileru�getvalue)rqr��gzfs   r
�gzip_encodervs���
�"�!�!��	�	�A�	
��D�!�1�	=�	=�	=����	�	�$�����������������������:�:�<�<�s�A�A�A�@c��tst�tjdt|�����5}	|dkr|���}n|�|dz��}n#t
$rt
d���wxYwddd��n#1swxYwY|dkr"t|��|krt
d���|S)zrgzip encoded data -> unencoded data

    Decode data using the gzip content encoding as described in RFC 1952
    �rb�rnrorr5zinvalid dataNz#max gzipped payload length exceeded)rqrrrsr�read�OSErrorr:r�)rq�
max_decoderu�decodeds    r
�gzip_decoder)s
��
�"�!�!�	
��D�'�$�-�-�	8�	8�	8�-�C�	-��A�~�~��(�(�*�*����(�(�:��>�2�2�����	-�	-�	-��^�,�,�,�	-����
-�-�-�-�-�-�-�-�-�-�-����-�-�-�-��Q���3�w�<�<�*�4�4��>�?�?�?��Ns(�B�3A(�'B�(B�B�B�Bc��eZdZdZd�Zd�ZdS)�GzipDecodedResponsezha file-like object to decode a response encoded with the gzip
    method, as described in RFC 1952.
    c��tst�t|�����|_tj�|d|j���dS)Nryrz)rqrrrr{�iorsr)r#�responses  r
rzGzipDecodedResponse.__init__GsN���	&�%�%��(�-�-�/�/�*�*����
���t�$����@�@�@�@�@rc��	tj�|��|j���dS#|j���wxYwr)rqrsr�r�r)s r
r�zGzipDecodedResponse.closeOsD��	��M����%�%�%��G�M�M�O�O�O�O�O��D�G�M�M�O�O�O�O���s	�<�AN)rrrrrr�rrr
r�r�Cs?��������A�A�A�����rr�c� �eZdZd�Zd�Zd�ZdS)�_Methodc�"�||_||_dSr��
_Method__send�
_Method__name)r#�sendrs   r
rz_Method.__init__\s���������rc�@�t|j|j�d|����Sr?)r�r�r�rAs  r
rBz_Method.__getattr___s!���t�{�t�{�{�{�D�D�$A�B�B�Brc�8�|�|j|��Srr�rDs  r
rFz_Method.__call__as���{�{�4�;��-�-�-rNrGrrr
r�r�YsD���������C�C�C�.�.�.�.�.rr�c�r�eZdZdZdezZdZdZddd�d�Zdd	�Z	dd
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Zd�ZdS)�	Transportz1Handles an HTTP transaction to an XML-RPC server.zPython-xmlrpc/%sTNFr)r"c�f�||_||_d|_t|��|_g|_dS�N)NN)r��_use_builtin_types�_connectionr��_headers�_extra_headers)r#r�r�r"s    r
rzTransport.__init__xs5��)���"3���'����W�
�
��
� ����rc��dD]x}	|�||||��cS#tjj$r|r�Y�6t$r7}|s*|jt
jt
jt
jfvr�Yd}~�qd}~wwxYwdS)N)rr5)	�single_request�http�client�RemoteDisconnectedr|�errno�
ECONNRESET�ECONNABORTED�EPIPE)r#�host�handler�request_body�verboser��es       r
�requestzTransport.request�s����		�		�A�
��*�*�4��,��P�P�P�P�P���;�1�
�
�
�������
�
�
������(8�%�:L�(-��(5�5�5��5�5�5�5�5�����
����
		�		s� �A9�	A9�-A4�4A9c	���	|�||||��}|���}|jdkr||_|�|��Sn-#t
$r�t$r|����wxYw|�dd��r|�	��t||z|j|jt|�
�������)N��zcontent-lengthr�)�send_request�getresponse�statusr��parse_responser/�	Exceptionr��	getheaderr{r�reasonr��
getheaders)r#r�r�r�r��	http_conn�resps       r
r�zTransport.single_request�s���
	��)�)�$���w�O�O�I��(�(�*�*�D��{�c�!�!�&����*�*�4�0�0�0�"���	�	�	���	�	�	�
�J�J�L�L�L��		�����>�>�*�B�/�/�	��I�I�K�K�K���7�N��K�������"�"�#�#���	s�AA�*Bc�8�t|j|j���S)Nr\)rar�r�r)s r
razTransport.getparser�s(���d�&8�+/�+B�D�D�D�	Drc�|�i}t|t��r|\}}tj�|��\}}|rvtj�|��}t
j|���d��}d�	|�
����}dd|zfg}ng}|||fS)Nr�r��
AuthorizationzBasic )rJrK�urllib�parse�
_splituser�unquote_to_bytesr�r�rrr�r�)r#r��x509�auth�
extra_headerss     r
�
get_host_infozTransport.get_host_info�s������d�E�"�"�	��J�D�$��\�,�,�T�2�2�
��d��	��<�0�0��6�6�D��%�d�+�+�2�2�7�;�;�D��7�7�4�:�:�<�<�(�(�D� �(�T�/�2��M�M��M��]�D�(�(rc���|jr||jdkr
|jdS|�|��\}|_}|tj�|��f|_|jdS)Nrr5)r�r�r�r�r��HTTPConnection�r#r��chostr�s    r
�make_connectionzTransport.make_connection�sw����	'���(8��(;� ;� ;��#�A�&�&�+/�+=�+=�d�+C�+C�(��t�"�D����!;�!;�E�!B�!B�B������"�"rc�X�|j\}}|rd|_|���dSdSr�)r�r�)r#r��
connections   r
r�zTransport.close�sA���+���j��	�+�D����������	�	rc���|�|��}|j|jz}|r|�d��|jr5t
r.|�d|d���|�d��n|�d|��|�d��|�d|jf��|�	||��|�
||��|S)Nr5�POSTT)�skip_accept_encoding)zAccept-Encodingrq)zContent-Typeztext/xmlz
User-Agent)r�r�r��set_debuglevel�accept_gzip_encodingrq�
putrequestr��
user_agent�send_headers�send_content)r#r�r�r��debugr�r"s       r
r�zTransport.send_request�s����)�)�$�/�/�
��-�$�"5�5���	)��%�%�a�(�(�(��$�	3��	3��!�!�&�'��!�M�M�M��N�N�6�7�7�7�7��!�!�&�'�2�2�2����3�4�4�4�����d�o�6�7�7�7����*�g�.�.�.����*�l�3�3�3��rc�B�|D]\}}|�||���dSr)�	putheader)r#r�r"�key�vals     r
r�zTransport.send_headerss8���	+�	+�H�C��� � ��c�*�*�*�*�	+�	+rc�&�|j�D|jt|��kr,tr%|�dd��t	|��}|�dtt|������|�|��dS)N�Content-EncodingrqzContent-Length)�encode_thresholdr�rqr�rvrS�
endheaders)r#r�r�s   r
r�zTransport.send_content s����!�-��!�C��$5�$5�5�5��
6�� � �!3�V�<�<�<�&�|�4�4�L����-�s�3�|�3D�3D�/E�/E�F�F�F����l�+�+�+�+�+rc���t|d��r-|�dd��dkrt|��}n|}n|}|���\}}	|�d��}|sn:|jrt
dt|����|�|���R||ur|�	��|�	��|�	��S)Nr�r�r�rqr5izbody:)
rVr�r�rar{r��printr�r�r�)r#r��streamrirjrqs      r
r�zTransport.parse_response1s����8�[�)�)�	��!�!�"4�b�9�9�V�C�C�,�X�6�6���!����F��~�~�����1�	��;�;�t�$�$�D��
���|�
+��g�t�D�z�z�*�*�*�
�F�F�4�L�L�L�
	���!�!��L�L�N�N�N�	���	�	�	��w�w�y�y�rr7)F)rrrr�__version__r�r�r�rr�r�rar�r�r�r�r�r�r�rrr
r�r�js�������;�;�$�k�1�J� ��
��!��!�!�!�!�!�$��������BD�D�D�)�)�)�4#�#�#�������.+�+�+�	,�	,�	,�"����rr�c�2��eZdZdZdddd��fd�Zd�Z�xZS)	�
SafeTransportz2Handles an HTTPS transaction to an XML-RPC server.FrN�r"�contextc�^��t���|||���||_dS)N�r�r�r")�superrr�)r#r�r�r"r�r(s     �r
rzSafeTransport.__init__Rs9���
�����l�+<�!(�	�	*�	*�	*�����rc�D�|jr||jdkr
|jdSttjd��st	d���|�|��\}|_}|tjj|dfd|ji|pi��f|_|jdS)Nrr5�HTTPSConnectionz1your version of http.client doesn't support HTTPSr�)	r�rVr�r�rrr�r�r�r�r�s    r
r�zSafeTransport.make_connection[s�����	'���(8��(;� ;� ;��#�A�&�&��t�{�$5�6�6�	A�%�?�A�A�
A�,0�+=�+=�d�+C�+C�(��t�"�D����!<�U��"8�"8��,�"8�+/�:�2�"8�"8�8������"�"rr7)rrrrrr��
__classcell__)r(s@r
r�r�Osa�������<�<�����������#�#�#�#�#�#�#rr�c�P�eZdZdZ		dddd�d�Zd�Zd�Zd	�Zd
�Zd�Z	d�Z
d
�ZdS)�ServerProxya�uri [,options] -> a logical connection to an XML-RPC server

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

    The standard implementation always supports the "http" scheme.  If
    SSL socket support is available (Python 2.0), it also supports
    "https".

    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
        encoding: the request encoding (default is UTF-8)

    All 8-bit strings passed to the server proxy are assumed to use
    the given encoding.
    NFrr�c��tj�|��}
|
jdvrt	d���|
j|_tj�ddg|
dd����|_|jsd|_|�,|
jdkrt}d|	i}n	t}i}|d
|||d�|��}||_|pd	|_||_
||_dS)N)r��httpszunsupported XML-RPC protocolr�rz/RPC2r�r�r�r�r)r�r��urlsplit�schemer|�netloc�_ServerProxy__host�
urlunsplit�_ServerProxy__handlerr�r��_ServerProxy__transport�_ServerProxy__encoding�_ServerProxy__verbose�_ServerProxy__allow_none)
r#�uri�	transportr�r�r�r�r�r"r�rir��extra_kwargss
             r
rzServerProxy.__init__�s���
�L�!�!�#�&�&���8�,�,�,��8�9�9�9��h�����0�0�"�b�1A�1�Q�R�R�5�1A�B�B����~�	%�$�D�N����x�7�"�"�'�� )�7�3���#��!����0�\�2C�(/�0�0�#/�0�0�I�%���"�-�g��� ���&����rc�8�|j���dSr)r�r�r)s r
�__closezServerProxy.__close�s������ � � � � rc��t|||j|j����|jd��}|j�|j|j||j���}t|��dkr|d}|S)N)r�r��xmlcharrefreplace)r�r5r)
r�r�r�rwr�r�r�r�r�r�)r#rdr/r�r�s     r
�	__requestzServerProxy.__request�s�����
�T�_�#'�#4�6�6�6�6<�f�T�_�Na�6b�6b�	��#�+�+��K��N���N�	,�����x�=�=�A�����{�H��rc�@�d|jj�d|j�|j�d�S)Nr	r%r
)r(rr�r�r)s r
r*zServerProxy.__repr__�s-����^�
$�
$�
$�d�k�k�4�>�>�>�
C�	rc�,�t|j|��Sr)r��_ServerProxy__requestrAs  r
rBzServerProxy.__getattr__�s���t�~�t�,�,�,rc�\�|dkr|jS|dkr|jStd|�d����)z|A workaround to get special attributes on the ServerProxy
           without interfering with the magic __getattr__
        r�r�z
Attribute z
 not found)�_ServerProxy__closer�r�)r#�attrs  r
rFzServerProxy.__call__�s@���7�?�?��<��
�[�
 �
 ��#�#��n����?�@�@�@rc��|Srrr)s r
�	__enter__zServerProxy.__enter__�s���rc�.�|���dSr)r�rDs  r
�__exit__zServerProxy.__exit__�s���������r)NNFFFF)rrrrrr�r�r*rBrFrrrrr
r�r�zs���������*DI�IN�'���'�'�'�'�'�>!�!�!����$���-�-�-�A�A�A��������rr��__main__zhttp://localhost:8000�ERROR�	r7)NNNF)rw)Vrr��sysrLr�decimalr�http.clientr��urllib.parser��xml.parsersrr�r�rrq�ImportErrorr�version_infor�r�r��PARSE_ERROR�SERVER_ERROR�APPLICATION_ERROR�SYSTEM_ERROR�TRANSPORT_ERROR�NOT_WELLFORMED_ERROR�UNSUPPORTED_ENCODING�INVALID_ENCODING_CHAR�INVALID_XMLRPC�METHOD_NOT_FOUND�INVALID_METHOD_PARAMS�INTERNAL_ERRORr�rrr-r/r�r�Booleanr8r<rCrOrQrzr|r~r�r�r�r�r�r9rIrPrcr]r^rar�rkrvrrsrr�r�r�r�r��ServerrrTr��currentTime�getCurrentTimer��multi�getData�pow�addr�rrr
�<module>r"s���r(�(�T�
�
�
�
�
�
�
�������������������������������������������K�K�K�K�������D�D�D�����#�#�#���(��!��,�,����	�������������������������������I���������E����&	�	�	�	�	�E�	�	�	�B�B�B�B�B�E�B�B�B� ���'�"	���A�q�������
�4��:�:�;�1�1�1�1�	�T�%�[�[�;�2�2�2�2�;�;�;�	��	5�	5�	5�P3�P3�P3�P3�P3�P3�P3�P3�d���6�6�6�!)�!)�!)�!)�!)�!)�!)�!)�F���
�f���
$�$�$�$�$�$�$�$�B`4�`4�`4�`4�`4�`4�`4�`4�N},�},�},�},�},�},�},�},�D	5�	5�	5�	5�	5�	5�	5�	5�D�D�D�D�D�D�D�D�  R� R� R� R� R� R� R� R�J26�5��5��.�����NBF��@�@�@�@�V(�(�(�(�,
�
�
�0����4�����4�;�$�-�-�V����,	.�	.�	.�	.�	.�	.�	.�	.�"`�`�`�`�`�`�`�`�J#�#�#�#�#�I�#�#�#�Ve�e�e�e�e�e�e�e�R
��
�z���
�[�0�
1�
1�F��
��f� �/�/�1�1�2�2�2�2������
��g�q�����������������
�I�f���E�	�M�M�O�O�O�	�I�I�a��N�N�N�	�I�I�a��N�N�N������	�	�H��E�(�O�O�O�O�	�	������
��g�q������������������'�s?�9�A�A�"G<�<H�H�H�&J�J�J�J