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੐)|#o0aڱ$I>}k&1`U#V?YsV x>{t1[I~D&(I$I/{H0fw"q"y%4 IXyE~M3 8XψL}qE$I[> nD?~sf ]o΁ cT6"?'_Ἣ $I>~.f|'!N?⟩0G KkXZE]ޡ;/&?k OۘH$IRۀwXӨ<7@PnS04aӶp.:@\IWQJ6sS%I$e5ڑv`3:x';wq_vpgHyXZ 3gЂ7{{EuԹn±}$I$8t;b|591nءQ"P6O5i }iR̈́%Q̄p!I䮢]O{H$IRϻ9s֧ a=`- aB\X0"+5"C1Hb?߮3x3&gşggl_hZ^,`5?ߎvĸ%̀M!OZC2#0x LJ0 Gw$I$I}<{Eb+y;iI,`ܚF:5ܛA8-O-|8K7s|#Z8a&><a&/VtbtLʌI$I$I$I$I$I$IRjDD%tEXtdate:create2022-05-31T04:40:26+00:00!Î%tEXtdate:modify2022-05-31T04:40:26+00:00|{2IENDB`Mini Shell

HOME


Mini Shell 1.0
DIR:/lib/python3/dist-packages/wadllib/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/wadllib/__pycache__/application.cpython-311.pyc
�

R
`�����dZeZgd�ZddlZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZ	ddl
mZn#e$r	ddlmZYnwxYw	ddlmcmZn#e$rddlmcmZYnwxYwddlmZmZddlmZmZddlmZd	Zd
Z d�Z!d�Z"d
�Z#Gd�de$��Z%Gd�de%��Z&Gd�de%��Z'Gd�de(��Z)Gd�d��Z*Gd�de)��Z+Gd�de+��Z,Gd�de)��Z-Gd�de)e*��Z.Gd �d!e*��Z/Gd"�d#e+e*��Z0Gd$�d%e)��Z1Gd&�d'e)��Z2Gd(�d)e+��Z3Gd*�d+e)��Z4Gd,�d-e)��Z5dS).a�Navigate the resources exposed by a web service.

The wadllib library helps a web client navigate the resources
exposed by a web service. The service defines its resources in a
single WADL file. wadllib parses this file and gives access to the
resources defined inside. The client code can see the capabilities of
a given resource and make the corresponding HTTP requests.

If a request returns a representation of the resource, the client can
bind the string representation to the wadllib Resource object.
)
�Application�Link�Method�NoBoundRepresentationError�	Parameter�RepresentationDefinition�ResponseDefinition�Resource�ResourceType�	WADLError�N)�quote)�	urlencode)�URI�merge)�
_make_unicode�
_string_types)�iso_strptimez	xmlns:mapz http://www.w3.org/2001/XMLSchemac��d|zS)z)Scope a tag name with the WADL namespace.z&{http://research.sun.com/wadl/2006/10}���tag_names �5/usr/lib/python3/dist-packages/wadllib/application.py�wadl_tagrHs
��3�h�>�>�c�&�dt|��zS)z#Turn a tag name into an XPath path.z./)rrs r�
wadl_xpathrMs���(�8�$�$�$�$rc�B�i}|D]}|�|�|���|S)z<Merge any number of dictionaries, some of which may be None.)�update)�dicts�final�dicts   r�_merge_dictsr"Rs4���E��������L�L�������Lrc��eZdZdZdS)rzAAn exception having to do with the state of the WADL application.N��__name__�
__module__�__qualname__�__doc__rrrrr[s������K�K��Drrc��eZdZdZdS)raAAn unbound resource was used where wadllib expected a bound resource.

    To obtain the value of a resource's parameter, you first must bind
    the resource to a representation. Otherwise the resource has no
    idea what the value is and doesn't even know if you've given it a
    parameter name that makes sense.
    Nr$rrrrr`s���������rrc��eZdZdZdS)�UnsupportedMediaTypeErrorz�A media type was given that's not supported in this context.

    A resource can only be bound to media types it has representations
    of.
    Nr$rrrr+r+js���������rr+c��eZdZdZdS)�WADLBasez?A base class for objects that contain WADL-derived information.Nr$rrrr-r-rs������I�I�I�Irr-c�$�eZdZdZdd�Z	dd�ZdS)�HasParametersMixinzAA mixin class for objects that have associated Parameter objects.Nc������|j���td���|j�gS|j�t	d����}|�gS��fd�|D��S)z6Find subsidiary parameters that have the given styles.Nz&Could not find any particular resource�paramc�h��g|].}|j�d���v�t�|����/S)�style)�attrib�getr)�.0�	param_tag�resource�styless  ��r�
<listcomp>z-HasParametersMixin.params.<locals>.<listcomp>�sI���<�<�<���#�'�'��0�0�F�:�:��(�I�.�.�:�:�:r)r8�
ValueError�tag�findallr)�selfr9r8�
param_tagss `` r�paramszHasParametersMixin.paramsys��������}�H����E�F�F�F��8���I��X�%�%�j��&9�&9�:�:�
����I�<�<�<�<�<�!+�<�<�<�	<rTc��t||��}i}|D]�}|j}|j�C||vr5|||jkr$td||�d|�d|j�d����|j||<d�|jD��}t|��dkr@||vr<|||vr2td||�d|�d	d
�|���d����|r|jr||vrtd|z���||vr||||<||=��t|��dkr7td
d�|�����z���|S)a�Make sure the given valueset is valid.

        A valueset might be invalid because it contradicts a fixed
        value or (if enforce_completeness is True) because it lacks a
        required value.

        :param params: A list of Parameter objects.
        :param param_values: A dictionary of parameter values. May include
           paramters whose names are not valid Python identifiers.
        :param enforce_completeness: If True, this method will raise
           an exception when the given value set lacks a value for a
           required parameter.
        :param kw_param_values: A dictionary of parameter values.
        :return: A dictionary of validated parameter values.
        NzValue 'z' for parameter 'z' conflicts with fixed value '�'c��g|]	}|j��
Sr)�value)r6�options  rr:z<HasParametersMixin.validate_param_values.<locals>.<listcomp>�s��@�@�@��v�|�@�@�@rrzInvalid value 'z': valid values are: "z", "�"z$No value for required parameter '%s'zUnrecognized parameter(s): '%s'z', ')	r"�name�fixed_valuer;�options�len�join�is_required�keys)	r>r@�param_values�enforce_completeness�kw_param_values�validated_valuesr1rGrIs	         r�validate_param_valuesz(HasParametersMixin.validate_param_values�s���"$�L�/�B�B�����	'�	'�E��:�D�� �,��L�(�(�$�T�*�e�.?�?�?�$�*�(4�T�(:�(:�(:�D�D�D�(-�(9�(9�(9�&;�<�<�<�&+�%6��T�"�@�@�%�-�@�@�@�G��G���q� � �T�\�%9�%9� ��&�g�5�5� �j�$�T�*�*�*�D�D�D�&�+�+�g�2F�2F�2F�2F�"H�I�I�I�%�
)��):�
)���,�,� �!G�#'�"(�)�)�)��|�#�#�)5�d�);� ��&� ��&���|���q� � ��>�%�{�{�<�+<�+<�+>�+>�?�?�@�A�A�
A��r�N)T)r%r&r'r(r@rRrrrr/r/vsG������K�K�
<�
<�
<�
<� 48�- �- �- �- �- �- rr/c�*�eZdZdZd�Zd�Zd�Zd�ZdS)�WADLResolvableDefinitionz=A base class for objects whose definitions may be references.c�"�d|_||_dS)z�Initialize with a WADL application.

        :param application: A WADLDefinition. Relative links are
            assumed to be relative to this object's URL.
        N)�_definition�application)r>rXs  r�__init__z!WADLResolvableDefinition.__init__�s�� ���&����rc���|j�|jS|���}|�	||_|S|j�|��}|�|��}|�td|z���||_|S)a�Return the definition of this object, wherever it is.

        Resource is a good example. A WADL <resource> tag
        may contain a large number of nested tags describing a
        resource, or it may just contain a 'type' attribute that
        references a <resource_type> which contains those same
        tags. Resource.resolve_definition() will return the original
        Resource object in the first case, and a
        ResourceType object in the second case.
        N�No such XML ID: "%s")rW�_get_definition_urlrX�
lookup_xml_id�_definition_factory�KeyError)r>�
object_url�xml_id�
definitions    r�resolve_definitionz+WADLResolvableDefinition.resolve_definition�s�����'��#�#��-�-�/�/�
��� $�D���K��!�/�/�
�;�;���-�-�f�5�5�
����1�J�>�?�?�?�%����rc��t���)zxTransform an XML ID into a wadllib wrapper object.

        Which kind of object it is depends on the subclass.
        ��NotImplementedError�r>�ids  rr^z,WADLResolvableDefinition._definition_factory����
"�#�#�#rc��t���)zmFind the URL that identifies an external reference.

        How to do this depends on the subclass.
        re�r>s rr\z,WADLResolvableDefinition._get_definition_url�rirN)r%r&r'r(rYrcr^r\rrrrUrU�sW������G�G�'�'�'� � � �D$�$�$�$�$�$�$�$rrUc����eZdZdZ			d�fd�	Zed���Zed���Zed���Z			dd	�Z	d
�Z
		dd�Zdd�Zdd
�Z
ed���Zdd�Zd�Zd�Zd�Zd�Zdd�Zd�Z�xZS)r	z/A resource, possibly bound to a representation.NTc���tt|���|��||_t	|t
��r%|j�|��j|_n||_d|_	|�I|dkr1|r'tjt|����|_	n||_	ntd|z���||_|�,|�	||_dS|�|j��|_dSdS)a[
        :param application: A WADLApplication.
        :param url: The URL to this resource.
        :param resource_type: An ElementTree <resource> or <resource_type> tag.
        :param representation: A string representation.
        :param media_type: The media type of the representation.
        :param representation_needs_processing: Set to False if the
            'representation' parameter should be used as
            is. Otherwise, it will be transformed from a string into
            an appropriate Python data structure, depending on its
            media type.
        :param representation_definition: A RepresentationDefinition
            object describing the structure of this
            representation. Used in cases when the representation
            isn't the result of sending a standard GET to the
            resource.
        N�application/jsonz?This resource doesn't define a representation for media type %s)�superr	rY�_url�
isinstancerrX�get_resource_typer<�representation�json�loadsrr+�
media_type�representation_definition�get_representation_definition)	r>rX�url�
resource_typersrv�representation_needs_processingrw�	__class__s	        �rrYzResource.__init__�s"���*	�h����&�&�{�3�3�3���	��m�]�3�3�	%��'�9�9�-�H�H�L�D�H�H�%�D�H�"����%��/�/�/�2�9�*.�*�%�n�5�5�+7�+7�D�'�'�+9�D�'�'�/�$�&0�1�2�2�2�%����%�(�4�1J��.�.�.��6�6�t��G�G��.�.�.�	&�%rc��|jS)z Return the URL to this resource.)rprks rryzResource.url,s���y�rc� �|j�dS|jj�d��}|�|S|jj�d��}|�@t|jj�����}t|��dz|zSdS)z@Return the URL to the type definition for this resource, if any.N�typerh�#)r<r4r5rrX�
markup_url�ensureSlash�str)r>ry�type_id�bases    r�type_urlzResource.type_url1s����8���4��h�o�!�!�&�)�)���?��J��(�/�%�%�d�+�+�����t�'�2�3�3�?�?�A�A�D��t�9�9�s�?�W�,�,��trc�&�|jjdS)zReturn the ID of this resource.rh)r<r4rks rrhzResource.idCs���x��t�$�$rrnc	�J�t|j|j|j||||��S)a�Bind the resource to a representation of that resource.

        :param representation: A string representation
        :param media_type: The media type of the representation.
        :param representation_needs_processing: Set to False if the
            'representation' parameter should be used as
            is.
        :param representation_definition: A RepresentationDefinition
            object describing the structure of this
            representation. Used in cases when the representation
            isn't the result of sending a standard GET to the
            resource.
        :return: A Resource bound to a particular representation.
        )r	rXryr<)r>rsrvr{rws     r�bindz
Resource.bindHs.��"��(�$�(�D�H�&�
�7�1�3�3�	3rc���|�d��j}|D]=}|���j}|j�d��|kr|cS�>t
d|z���)z<Get a description of one of this resource's representations.�GET�	mediaTypez4No definition for representation with media type %s.)�
get_method�responsercr<r4r5r+)r>rv�default_get_responsers�representation_tags     rrxz&Resource.get_representation_definition^s���#���u�5�5�>��2�	&�	&�N�!/�!B�!B�!D�!D�!H��!�(�,�,�[�9�9�Z�G�G�%�%�%�%�H�'�)>�@J�)K�L�L�	Lrc��|���D]t}|j�dd�����}|�||���kr+t	||��}|�|||��r|cS�udS)aLook up one of this resource's methods by HTTP method.

        :param http_method: The HTTP method used to invoke the desired
                            method. Case-insensitive and optional.

        :param media_type: The media type of the representation
                           accepted by the method. Optional.

        :param query_params: The names and values of any fixed query
                             parameters used to distinguish between
                             two methods that use the same HTTP
                             method. Optional.

        :param representation_params: The names and values of any
                             fixed representation parameters used to
                             distinguish between two methods that use
                             the same HTTP method and have the same
                             media type. Optional.

        :return: A MethodDefinition, or None if there's no definition
                  that fits the given constraints.
        rG�N)�_method_tag_iterr4r5�lowerr�is_described_by)r>�http_methodrv�query_params�representation_params�
method_tagrG�methods        rr�zResource.get_methodhs���0�/�/�1�1�	"�	"�J��$�(�(���4�4�:�:�<�<�D��"�d�k�.?�.?�.A�.A�&A�&A���j�1�1���)�)�*�l�*?�A�A�"�!�M�M�M���trc�R�|�|���|��S)a~A list of this resource's parameters.

        :param media_type: Media type of the representation definition
            whose parameters are being named. Must be present unless
            this resource is bound to a representation.

        :raise NoBoundRepresentationError: If this resource is not
            bound to a representation and media_type was not provided.
        )�_find_representation_definitionr@�r>rvs  r�
parameterszResource.parameters�s*���3�3������t���	%rc�R�|�|���|��S)a�A list naming this resource's parameters.

        :param media_type: Media type of the representation definition
            whose parameters are being named. Must be present unless
            this resource is bound to a representation.

        :raise NoBoundRepresentationError: If this resource is not
            bound to a representation and media_type was not provided.
        )r��parameter_namesr�s  rr�zResource.parameter_names�s,���3�3����'���-�-�	.rc#�\K�|���D]}t||��V��dS)z6An iterator over the methods defined on this resource.N)r�r)r>r�s  r�method_iterzResource.method_iter�sF�����/�/�1�1�	+�	+�J���z�*�*�*�*�*�*�	+�	+rc���|�|��}|j}|�td����D]2}|j�d��|krt
||��cS�3dS)a�Find a parameter within a representation definition.

        :param param_name: Name of the parameter to find.

        :param media_type: Media type of the representation definition
            whose parameters are being named. Must be present unless
            this resource is bound to a representation.

        :raise NoBoundRepresentationError: If this resource is not
            bound to a representation and media_type was not provided.
        r1rGN)r�r<r=rr4r5r)r>�
param_namervrbr�r7s      r�
get_parameterzResource.get_parameter�s����9�9�*�E�E�
�'�^��+�3�3�J�w�4G�4G�H�H�	2�	2�I���#�#�F�+�+�z�9�9� ��y�1�1�1�1�1�:��trc��|j�td���|jdkr�|jdkrt	d|jz���|j|j}|��|�|j|j��\}}|tkrm|dvri	t|��}nX#t$rK	tjtj|d��dd	��}n#t$rt|���wxYwYnwxYw|St	d
|jz���)z�Find the value of a parameter, given the Parameter object.

        :raise ValueError: If the parameter value can't be converted into
        its defined type.
        Nz,Resource is not bound to any representation.rn�plain�8Don't know how to find value for a parameter of type %s.)�dateTime�datez%Y-%m-%dr�zEPath traversal not implemented for a representation of media type %s.)rsrrvr3rfrG�_dereference_namespacer<r�XML_SCHEMA_NS_URIrr;�datetime�time�strptime)r>�	parameterrD�
namespace_url�	data_types     r�get_parameter_valuezResource.get_parameter_value�sl����&�,�>�@�@�
@��?�0�0�0���'�)�)�)��!*��1�2�2�2��'�	��7�E�� �+/�+F�+F��M�9�>�,3�,3�(�
�y�!�%6�6�6�!�%9�9�9�4� ,�U� 3� 3����%�	4�	4�	4�4�$,�$5�"&�-��z�"B�"B�1�Q�3�"G�%J�E�E��)�4�4�4�#-�U�"3�"3�3�	4����"�E�	4�����L�!�#G�$(�O�#4�5�5�	5s*�B�
C0�&)C�C0�C*�*C0�/C0c��|�d|vr|�dd��\}}nd}|�t��}|�|d��}||fS)z�Splits a value into namespace URI and value.

        :param tag: A tag to use as context when mapping namespace
        names to URIs.
        N�:�r�)�splitr5�NS_MAP)r>r<rD�	namespace�ns_mapr�s      rr�zResource._dereference_namespace�s^��������$�{�{�3��2�2��I�u�u��I���������
�
�9�d�3�3�
��e�#�#rc�@�|jj�|��S)z-Given an ID, find a ResourceType for that ID.)rX�resource_typesr5rgs  rr^zResource._definition_factory�s����.�2�2�2�6�6�6rc�@�|jj�d��S)z�Return the URL that shows where a resource is 'really' defined.

        If a resource's capabilities are defined by reference, the
        <resource> tag's 'type' attribute will contain the URL to the
        <resource_type> that defines them.
        r�r<r4r5rks rr\zResource._get_definition_url�����x��"�"�6�*�*�*rc��|j�|j���}n'|�|�|��}nt	d���|���S)a3Get the most appropriate representation definition.

        If media_type is provided, the most appropriate definition is
        the definition of the representation of that media type.

        If this resource is bound to a representation, the most
        appropriate definition is the definition of that
        representation. Otherwise, the most appropriate definition is
        the definition of the representation served in response to a
        standard GET.

        :param media_type: Media type of the definition to find. Must
            be present unless the resource is bound to a
            representation.

        :raise NoBoundRepresentationError: If this resource is not
            bound to a representation and media_type was not provided.

        :return: A RepresentationDefinition
        NzSResource is not bound to any representation, and no media media type was specified.)rsrwrcrxr)r>rvrbs   rr�z(Resource._find_representation_definitionsk��*��*��7�J�J�L�L�J�J�
�
#��;�;�J�G�G�J�J�,�,�-�-�
-��,�,�.�.�.rc#�K�|���j}|�td����D]}|V��dS)z+Iterate over this resource's <method> tags.r�N)rcr<r=r)r>rbr�s   rr�zResource._method_tag_iter*sX�����,�,�.�.�2�
�$�,�,�Z��-A�-A�B�B�	�	�J������	�	r)NNTN)rnTN)NNNNrS)r%r&r'r(rY�propertyryr�rhr�rxr�r�r�r�r�r�r�r^r\r�r��
__classcell__�r|s@rr	r	�s��������9�9�26�15�+/�2I�2I�2I�2I�2I�2I�h����X������X��"�%�%��X�%�/A�-1�'+�3�3�3�3�,L�L�L�JN�)-�����B%�%�%�%�.�.�.�.��+�+��X�+�
����&-5�-5�-5�`$�$�$�7�7�7�+�+�+� /� /� /� /�F������rr	c��eZdZdZd�Zed���Zed���Zed���Zed���Z	dd�Z
		dd	�Z		d
d
�ZdS)rz*A wrapper around an XML <method> tag.
    c�D�||_|jj|_||_dS)zaInitialize with a <method> tag.

        :param method_tag: An ElementTree <method> tag.
        N)r8rXr<)r>r8r�s   rrYzMethod.__init__4s#��
!��
��=�4�������rc�l�t||j�td������S)z@Return the definition of a request that invokes the WADL method.�request)�RequestDefinitionr<�findrrks rr�zMethod.request=s*��!��t�x�}�}�Z�	�5J�5J�'K�'K�L�L�Lrc�v�t|j|j�t	d������S)z9Return the definition of the response to the WADL method.r�)rr8r<r�rrks rr�zMethod.responseBs6��"�$�-�"&�(�-�-�
�:�0F�0F�"G�"G�I�I�	Irc�@�|jj�d��S)z)The XML ID of the WADL method definition.rhr�rks rrhz	Method.idHs���x��"�"�4�(�(�(rc�d�|jj�d�����S)z�The name of the WADL method definition.

        This is also the name of the HTTP method (GET, POST, etc.)
        that should be used to invoke the WADL method.
        rG�r<r4r5r�rks rrGzMethod.nameMs(���x��"�"�6�*�*�0�0�2�2�2rNc�(�|jj|fi|��S)�4Return the request URL to use to invoke this method.)r��	build_url)r>rNrPs   r�build_request_urlzMethod.build_request_urlVs��%�t�|�%�l�F�F�o�F�F�Frc�*�|jj||fi|��S)z�Build a representation to be sent when invoking this method.

        :return: A 2-tuple of (media_type, representation).
        )r�rs)r>rvrNrPs    r�build_representationzMethod.build_representationZs/��+�t�|�*���9�9�(7�9�9�	9rc���d}|�|j�|��}|�dS|�Mt|��dkr:|j}|�dS	|�|j|d��n#t
$rYdSwxYw|�t|��dkrdS|�|�|��S|jjD]D}	|�|�|j	��|d��dS#t
$rY�AwxYwdS)aReturns true if this method fits the given constraints.

        :param media_type: The method must accept this media type as a
                           representation.

        :param query_values: These key-value pairs must be acceptable
                           as values for this method's query
                           parameters. This need not be a complete set
                           of parameters acceptable to the method.

        :param representation_values: These key-value pairs must be
                           acceptable as values for this method's
                           representation parameters. Again, this need
                           not be a complete set of parameters
                           acceptable to the method.
        NFrT)
r�rxrJrRr�r;r��representationsr@r8)r>rv�query_values�representation_valuesrsr�s      rr�zMethod.is_described_bycsf��$���!�!�\�G�G����N��%��u��#��L�(9�(9�A�(=�(=��l�G����u�
��-�-��(�,��?�?�?�?���
�
�
��u�u�
����
"�)��(�)�)�Q�.�.��4��%�!�1�1�%�'�'�
'�"�l�:�	�	�N�
��4�4�"�)�)�$�-�8�8�)�5�2�2�2��t�t���
�
�
���
�����us$�A!�!
A/�.A/�//C!�!
C.�-C.rS�NN)NNN)
r%r&r'r(rYr�r�r�rhrGr�r�r�rrrrr1s�������������M�M��X�M��I�I��X�I�
�)�)��X�)��3�3��X�3�G�G�G�G�/3�*.�9�9�9�9�=A�.2�5�5�5�5�5�5rrc�\�eZdZdZd�Zed���Zed���Zd	d�Zd
d�Z	d	d�Z
dS)r�zBA wrapper around the description of the request invoking a method.c�f�||_|jj|_|jj|_||_dS)z�Initialize with a <request> tag.

        :param resource: The resource to which this request can be sent.
        :param request_tag: An ElementTree <request> tag.
        N)r�r8rXr<)r>r��request_tags   rrYzRequestDefinition.__init__�s/�������,��
��=�4�������rc�.�|�dg��S)z,Return the query parameters for this method.�query�r@rks rr�zRequestDefinition.query_params�s���{�{�G�9�%�%�%rc#�K�|j�td����D]}t|j|j|��V�� dS)Nrs)r<r=rrrXr8)r>rbs  rr�z!RequestDefinition.representations�se�����(�*�*�:�6F�+G�+G�H�H�	=�	=�J�*�� �$�-��=�=�
=�
=�
=�
=�	=�	=rNc�<�|jD]}|�|j|kr|cS�dS)z1Return the appropriate representation definition.N)r�rv�r>rvrss   rrxz/RequestDefinition.get_representation_definition�s>��"�2�	&�	&�N��!�^�%>�*�%L�%L�%�%�%�%�&M��trc�p�|�|��}|�td|z���|j|fi|��S)z�Build a representation to be sent along with this request.

        :return: A 2-tuple of (media_type, representation).
        Nz,Cannot build representation of media type %s)rx�	TypeErrorr�)r>rvrNrPrbs     rrsz RequestDefinition.representation�sT���7�7�
�C�C�
����J�(�)�*�*�
*��z��|�?�?��?�?�?rc���|j|j|fi|��}|jj}t	|��dkr=d|vrd}nd}||tt
|�������zz
}|S)r�r�?�&)rRr�r8ryrJr�sorted�items)r>rNrPrQry�appends      rr�zRequestDefinition.build_url�s���5�4�5���|�@�@�/>�@�@���m����� � �1�$�$��c�z�z�������6�I�f�-=�-C�-C�-E�-E�&F�&F�G�G�G�G�C��
rrSr�)r%r&r'r(rYr�r�r�rxrsr�rrrr�r��s�������L�L�	�	�	��&�&��X�&��=�=��X�=�
����
@�
@�
@�
@������rr�c�8�eZdZdZd	d�Zd�Zd�Zd�Zd�Zd�Z	dS)
rz;A wrapper around the description of a response to a method.Nc�H�|j|_||_||_||_dS)zgInitialize with a <response> tag.

        :param response_tag: An ElementTree <response> tag.
        N)rXr8r<�headers)r>r8�response_tagr�s    rrYzResponseDefinition.__init__�s(��
$�/��� ��
��������rc#�K�td��}|j�|��D]$}t|jj|j|��V��%dS)z�Get an iterator over the representation definitions.

        These are the representations returned in response to an
        invocation of this method.
        rsN)rr<r=rr8rX)r>�pathr�s   r�__iter__zResponseDefinition.__iter__�sz�����*�+�+��"&�(�"2�"2�4�"8�"8�	N�	N��*��
�)�4�=�:L�N�N�
N�
N�
N�
N�	N�	Nrc�8�t|j|j|��S)z�Bind the response to a set of HTTP headers.

        A WADL response can have associated header parameters, but no
        other kind.
        )rr8r<)r>r�s  rr�zResponseDefinition.bind�s��"�$�-���7�C�C�Crc��|j�td����D]P}|j�d��|kr0|j�d��dkrt||��cS�QdS)z,Find a header parameter within the response.r1rGr3�headerN)r<r=rr4r5r)r>r�r7s   rr�z ResponseDefinition.get_parameter�s}����)�)�*�W�*=�*=�>�>�	2�	2�I�� �$�$�V�,�,�
�:�:��$�(�(��1�1�X�=�=� ��y�1�1�1�1�1���trc��|j�td���|jdkrtd|jz���|j�|j��S)z:Find the value of a parameter, given the Parameter object.Nz,Response object is not bound to any headers.r�r�)r�rr3rfr5rG)r>r�s  rr�z&ResponseDefinition.get_parameter_valuesj���<��,�>�@�@�
@��?�h�&�&�%��&�_�-�.�.�
.��|���	��/�/�/rc�@�|j�dS|D]}|j|kr|cS�dS)z8Get one of the possible representations of the response.N)r<rvr�s   rrxz0ResponseDefinition.get_representation_definitionsB���8���4�"�	&�	&�N��(�J�6�6�%�%�%�%�7��trrS)
r%r&r'r(rYr�r�r�r�rxrrrrr�s������E�E�����	N�	N�	N�D�D�D����	0�	0�	0�����rrc�t��eZdZdZ�fd�Z�fd�Zd�Zed���Zd�Z	d�Z
dd	�Zd
�Zd�Z
d�Zd
�Z�xZS)rz2A definition of the structure of a representation.c�t��tt|���|��||_||_dSrS)rorrYr8r<)r>rXr8r�r|s    �rrYz!RepresentationDefinition.__init__s4���
�&��-�-�6�6�{�C�C�C� ��
�%����rc�Z��tt|���ddg|��S)Nr�r�)rorr@)r>r8r|s  �rr@zRepresentationDefinition.paramss0����-�t�4�4�;�;�
�g���*�*�	*rc�@�d�|�|��D��S)z#Return the names of all parameters.c��g|]	}|j��
Sr)rG)r6r1s  rr:z<RepresentationDefinition.parameter_names.<locals>.<listcomp>$s��>�>�>�u��
�>�>�>rr�)r>r8s  rr�z(RepresentationDefinition.parameter_names"s"��>�>����H�(=�(=�>�>�>�>rc�J�|���jjdS)z4The media type of the representation described here.r�)rcr<r4rks rrvz#RepresentationDefinition.media_type&s!���&�&�(�(�,�3�K�@�@rc��tttjdz
����}d|z}t	jtj��}d||zzdz}|�|S|}d}	dt
j|��zd	z�d
��}t
j	||tj
���sn|dzt|��z}|dz
}�j|S)
z;Make a random boundary that does not appear in `all_parts`.r�z%%0%ddz===============z==NrTz^--z(--)?$�ascii)�flags�.)rJ�repr�sys�maxsize�random�	randrange�re�escape�encode�search�	MULTILINEr�)	r>�	all_parts�_width�_fmt�token�boundary�b�counter�patterns	         r�_make_boundaryz'RepresentationDefinition._make_boundary+s����T�#�+��/�*�*�+�+���&� ��� ���-�-������.��5�����O�����	��r�y��|�|�+�h�6�>�>�w�G�G�G��9�W�i�r�|�D�D�D�
���3���W���-�A��q�L�G�	��rc�4�|D]\}}|�|�d����|�d��|�|�d����|�d����|�d��dS)z$Write MIME headers to a file object.�UTF-8s: �
N��writer	)r>�bufr��keyrDs     r�_write_headersz'RepresentationDefinition._write_headers=s���!�	�	�J�C���I�I�c�j�j��)�)�*�*�*��I�I�e�����I�I�e�l�l�7�+�+�,�,�,��I�I�g������	�	�'�����rFc���|�d��|�|�d����|r|�d��|�d��dS)z,Write a multipart boundary to a file object.s--rrNr)r>rr�closings    r�_write_boundaryz(RepresentationDefinition._write_boundaryFsd���	�	�%�����	�	�(�/�/�'�*�*�+�+�+��	��I�I�e�����	�	�'�����rc��g}|D�]�\}}}tj��}|r&d}dt|���dt|���d�}nd}dt|��z}|�|dd|fd	|fg��|rJt	|t
��st
d
t|��z���|�|��n�t	|t��st
dt|��z���tjd|��}	|	d
d�D]?}
|�|
�d����|�d���@|�|	d�d����|�
|��������|�d�|����}tj��}dt|��z}|�|dd|fg��|D]B}|�||��|�|��|�d���C|�||d���||���fS)aVGenerate a multipart/form-data message.

        This is very loosely based on the email module in the Python standard
        library.  However, that module doesn't really support directly embedding
        binary data in a form: various versions of Python have mangled line
        separators in different ways, and none of them get it quite right.
        Since we only need a tiny subset of MIME here, it's easier to implement
        it ourselves.

        :return: a tuple of two elements: the Content-Type of the message, and
            the entire encoded message as a byte string.
        zapplication/octet-streamzform-data; name="z
"; filename="rFztext/plain; charset="utf-8"zform-data; name="%s")zMIME-Versionz1.0zContent-TypezContent-Dispositionzbytes payload expected: %szstring payload expected: %sz
\r\n|\r|\nN���rrz"multipart/form-data; boundary="%s"T)r)�io�BytesIOr
rrq�bytesr�rrrrr�r	r��getvaluerrKr)
r>�parts�
encoded_parts�	is_binaryrGrDr�ctype�cdisp�lines�liner�encoded_parts
             r�_generate_multipart_formz1RepresentationDefinition._generate_multipart_formNs����
�&+�	1�	1�"�I�t�U��*�,�,�C��	
=�2���
�$�K�K�K�K��t�����.���6��.��t���<������'���'�&��.�&�
�
�
�
�
5�!�%��/�/�P�#�$@�4��;�;�$N�O�O�O��	�	�%� � � � �!�%��7�7�E�#�5��U���C�E�E�E�����6�6��!�#�2�#�J�'�'�D��I�I�d�k�k�'�2�2�3�3�3��I�I�g�&�&�&�&��	�	�%��)�*�*�7�3�3�4�4�4�� � ������0�0�0�0��&�&�w�|�|�M�'B�'B�C�C���j�l�l��4�u�X���F�����C�#�
�U�#�"�	�	�	�*�	�	�L�� � ��h�/�/�/��I�I�l�#�#�#��I�I�g��������S�(�D��9�9�9��c�l�l�n�n�$�$rc�H�|���}|�|j��}|j||fi|��}|j}|dkr/tt
|�������}n�|dkrsg}t��}	|D]G}
|�	|
j
|	��}||	ur&|�|
jdk|
j
|f���H|�
|��\}}n-|dkrtj|��}nt!d|z���||fS)zzBind the definition to parameter values, creating a document.

        :return: A 2-tuple (media_type, document).
        z!application/x-www-form-urlencodedzmultipart/form-data�binaryrnzUnsupported media type: '%s')rcr@r8rRrvrr�r��objectr5rGr�rr.rt�dumpsr;)r>rNrPrbr@rQrv�docr&�missingr1rDs            rr�zRepresentationDefinition.bind�sM��
�,�,�.�.�
��"�"�4�=�1�1��5�4�5��L�5�5�$3�5�5���_�
��<�<�<��F�#3�#9�#9�#;�#;�<�<�=�=�C�C�
�0�
0�
0��E��h�h�G��
N�
N��(�,�,�U�Z��A�A����'�'��L�L�%�*��"8�%�*�e�!L�M�M�M��"�;�;�E�B�B�O�J���
�-�
-�
-��*�-�.�.�C�C��;�j�H�I�I�I��3��rc�@�|jj�|��S)z9Turn a representation ID into a RepresentationDefinition.)rX�representation_definitionsr5rgs  rr^z,RepresentationDefinition._definition_factory�s����:�>�>�r�B�B�Brc�@�|jj�d��S)aFind the URL containing the representation's 'real' definition.

        If a representation's structure is defined by reference, the
        <representation> tag's 'href' attribute will contain the URL
        to the <representation> that defines the structure.
        �hrefr�rks rr\z,RepresentationDefinition._get_definition_url�r�r)F)r%r&r'r(rYr@r�r�rvrrrr.r�r^r\r�r�s@rrrs��������<�<�&�&�&�&�&�
*�*�*�*�*�?�?�?��A�A��X�A����$�������?%�?%�?%�B���4C�C�C�+�+�+�+�+�+�+rrc���eZdZdZd�Zed���Zed���Zed���Zed���Z	ed���Z
d�Zed	���Zed
���Z
ed���ZdS)
rz5One of the parameters of a representation definition.c�:�|j|_||_||_dS)a�Initialize with respect to a value container.

        :param value_container: Usually the resource whose representation
            has this parameter. If the resource is bound to a representation,
            you'll be able to find the value of this parameter in the
            representation. This may also be a server response whose headers
            define a value for this parameter.
        :tag: The ElementTree <param> tag for this parameter.
        N)rX�value_containerr<)r>r;r<s   rrYzParameter.__init__�s"��+�6���.�������rc�@�|jj�d��S)zThe name of this parameter.rGr�rks rrGzParameter.name�����x��"�"�6�*�*�*rc�@�|jj�d��S)zThe style of this parameter.r3r�rks rr3zParameter.style�s���x��"�"�7�+�+�+rc�@�|jj�d��S)zThe XSD type of this parameter.rr�rks rrzParameter.type�r=rc�@�|jj�d��S)a9The value to which this parameter is fixed, if any.

        A fixed parameter must be present in invocations of a WADL
        method, and it must have a particular value. This is commonly
        used to designate one parameter as containing the name of the
        server-side operation to be invoked.
        �fixedr�rks rrHzParameter.fixed_value�s���x��"�"�7�+�+�+rc�j�|jj�dd�����dvS)z6Whether or not a value for this parameter is required.�required�false)�1�truer�rks rrLzParameter.is_required�s4�����#�#�J��8�8�>�>�@�@� �!�	"rc�6�|j�|��S)z�The value of this parameter in the bound representation/headers.

        :raise NoBoundRepresentationError: If this parameter's value
               container is not bound to a representation or a set of
               headers.
        )r;r�rks r�	get_valuezParameter.get_value�s���#�7�7��=�=�=rc�j���fd��j�td����D��S)z7Return the set of acceptable values for this parameter.c�0��g|]}t�|����Sr)�Option)r6�
option_tagr>s  �rr:z%Parameter.options.<locals>.<listcomp>�s9���K�K�K���t�Z�(�(�K�K�KrrE)r<r=rrks`rrIzParameter.options�sN���K�K�K�K�#'�8�#3�#3�J�x�4H�4H�#I�#I�K�K�K�	Krc�x�|j�td����}|�dSt||��S)z�Get the link to another resource.

        The link may be examined and, if its type is of a known WADL
        description, it may be followed.

        :return: A Link object, or None.
        �linkN)r<r�rr)r>�link_tags  rrNzParameter.link�s:���8�=�=��F�!3�!3�4�4�����4��D�(�#�#�#rc�@�|j}|�td���|jS)aFollow a link from this parameter to a new resource.

        This only works for parameters whose WADL definition includes a
        <link> tag that points to a known WADL description.

        :return: A Resource object for the resource at the other end
        of the link.
        Nz(This parameter isn't a link to anything.)rNr;�follow)r>rNs  r�linked_resourcezParameter.linked_resources'���y���<��G�H�H�H��{�rN)r%r&r'r(rYr�rGr3rrHrLrHrIrNrRrrrrr�s������?�?�����+�+��X�+��,�,��X�,��+�+��X�+��,�,��X�,��"�"��X�"�
>�>�>��K�K��X�K�
�$�$��X�$�����X���rrc�.�eZdZdZd�Zed���ZdS)rKz0One of a set of possible values for a parameter.c�"�||_||_dS)z}Initialize the option.

        :param parameter: A Parameter.
        :param link_tag: An ElementTree <option> tag.
        N)r�r<)r>r�rLs   rrYzOption.__init__s��#�������rc�@�|jj�d��S)NrDr�rks rrDzOption.value s���x��"�"�7�+�+�+rN)r%r&r'r(rYr�rDrrrrKrKsD������:�:�����,�,��X�,�,�,rrKc�Z��eZdZdZ�fd�Zed���Zed���Zd�Zd�Z	�xZ
S)rz�A link from one resource to another.

    Calling resolve_definition() on a Link will give you a Resource for the
    type of resource linked to. An alias for this is 'follow'.
    c�~��tt|���|j��||_||_dS)zyInitialize the link.

        :param parameter: A Parameter.
        :param link_tag: An ElementTree <link> tag.
        N)rorrYrXr�r<)r>r�rOr|s   �rrYz
Link.__init__,s8���	�d�D���"�"�9�#8�9�9�9�"�������rc�V�|jstd���|���S)z$Follow the link to another Resource.zfCannot follow a link when the target has no WADL description. Try using a general HTTP client instead.)�
can_followrrcrks rrQzLink.follow6s9����	/��.�/�/�
/��&�&�(�(�(rc�T�	|���}n#t$rYdSwxYwdS)z�Can this link be followed within wadllib?

        wadllib can follow a link if it points to a resource that has
        a WADL definition.
        FT)r\r)r>�definition_urls  rrYzLink.can_follow?sA��	�!�5�5�7�7�N�N���	�	�	��5�5�	�����ts��
%�%c��t|j|j���|jj�|��j��S)z,Turn a resource type ID into a ResourceType.)r	rXr�rHr�r5r<rgs  rr^zLink._definition_factoryLsD�����d�n�6�6�8�8���+�/�/��3�3�7�9�9�	9rc�f�|jj�d��}|�td���|S)z(Find the URL containing the definition .rzNzIParameter is a link, but not to a resource with a known WADL description.)r<r4r5r)r>rs  rr\zLink._get_definition_urlRs:���x��"�"�?�3�3���<��=�>�>�
>��r)r%r&r'r(rYr�rQrYr^r\r�r�s@rrr%s����������������)�)��X�)��
�
��X�
�9�9�9�������rrc��eZdZdZd�ZdS)r
z,A wrapper around an XML <resource_type> tag.c��||_dS)zvInitialize with a <resource_type> tag.

        :param resource_type_tag: An ElementTree <resource_type> tag.
        N)r<)r>�resource_type_tags  rrYzResourceType.__init__^s��
%����rN)r%r&r'r(rYrrrr
r
[s)������6�6�%�%�%�%�%rr
c�6�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	dS)	rz1A WADL document made programmatically accessible.c��||_t|d��r|�|��|_n|�|��|_|j�t
d����|_|jj�	d��|_
i|_i|_|j�
t
d����D]9}|j�	d��}|�t|d|��}||j|<�:|j�
t
d����D]&}|jd}t|��|j|<�'dS)z�Parse WADL and find the most important parts of the document.

        :param markup_url: The URL from which this document was obtained.
        :param markup: The WADL markup itself, or an open filehandle to it.
        �read�	resourcesr�rsrhNrz)r��hasattr�_from_streamr3�_from_stringr�rrdr4r5�
resource_baser6r�r=rr
)r>r��markuprsrhrbrzs       rrYzApplication.__init__isT��%����6�6�"�"�	1��(�(��0�0�D�H�H��(�(��0�0�D�H�����z�+�'>�'>�?�?���!�^�2�6�6�v�>�>���*,��'� ���"�h�.�.�z�:J�/K�/K�L�L�	A�	A�N��&�*�*�4�0�0�B��~�5��$��0�0�
�6@��/��3��!�X�-�-�j��.I�.I�J�J�	B�	B�M��%�d�+�B�&2�=�&A�&A�D���#�#�	B�	Brc�>�d}d}g}tj||��D]n\}}|dkr|�|���!|dkr|����<|dkr,|�|}|�t
t
|�����otj|��S)zrTurns markup into a document.

        Just a wrapper around ElementTree which keeps track of namespaces.
        )�start�start-ns�end-nsNrlrmrk)�ET�	iterparser��pop�setr�r!�ElementTree)r>�stream�events�rootr��event�elems       rrfzApplication._from_stream�s���
/�������<���7�7�	/�	/�K�E�4��
�"�"��
�
�d�#�#�#�#��(�"�"��
�
������'�!�!��<��D������f���.�.�.���~�d�#�#�#rc��t|t��s|�d��}|�t	j|����S)zTurns markup into a document.r)rqr$r	rfr"r#)r>ris  rrgzApplication._from_string�sC���&�%�(�(�	,��]�]�7�+�+�F�� � ���F�!3�!3�4�4�4rc��|�|��}|j�|��}|�td|z���|S)z7Retrieve a resource type by the URL of its description.Nr[)r]r�r5r_)r>�resource_type_urlrarzs    rrrzApplication.get_resource_type�sM���#�#�$5�6�6���+�/�/��7�7�
�� ��1�4E�E�F�F�F��rc�D�t|j�����}d|_|�d��r"t|�����}n|�|��}|j}d|_||kr|St
d|z���)z�A helper method for locating a part of a WADL document.

        :param url: The URL (with anchor) of the desired part of the
        WADL document.
        :return: The XML ID corresponding to the anchor.
        N�httpz,Can't look up definition in another url (%s))rr��
ensureNoSlash�fragment�
startswith�resolverf)r>ry�
markup_uri�this_uri�possible_xml_ids     rr]zApplication.lookup_xml_id�s������)�)�7�7�9�9�
�"�
���>�>�&�!�!�	/��3�x�x�-�-�/�/�H�H�"�)�)�#�.�.�H�"�+�� ����z�!�!�#�"�"�#-�/2�#3�4�4�	4rc�����fd�|jD��}t|��dkrdSt|��dkrtd�z���t|t	|j�d��|d��S)zpLocate one of the resources described by this document.

        :param path: The path to the resource.
        c�6��g|]}|jd�k�|��S)r�)r4)r6r8r�s  �rr:z4Application.get_resource_by_path.<locals>.<listcomp>�s4���8�8�8����v�.�$�6�6��6�6�6rr�Nz+More than one resource defined with path %sTr)rdrJrr	rrh)r>r��matchings ` r�get_resource_by_pathz Application.get_resource_by_path�s����8�8�8�8�T�^�8�8�8���x�=�=�1����4��x�=�=�1����I�"�#�$�$�
$���%��*�D�$�7�7��!��F�F�	FrN)
r%r&r'r(rYrfrgrrr]r�rrrrrfs}������;�;�B�B�B�2$�$�$�(5�5�5����4�4�4�@F�F�F�F�Frr)6r(r�
__metaclass__�__all__r��email.utilsr
r"rtrrrr��urllib.parser�ImportError�urllib�xml.etree.cElementTree�etree�cElementTreern�xml.etree.ElementTreerr�lazr.urirr�wadllibrr�wadllib.iso_strptimerr�r�rrr"�	Exceptionrrr+r1r-r/rUr	rr�rrrrKrr
rrrr�<module>r�s���"
�
��
���������������	�	�	�	�����
�
�
�
�	�	�	�	�
�
�
�
�����!�&�&�&�&�&�&�&���!�!�!� � � � � � � � �!����'�'�'�'�'�'�'�'�'�'�'���'�'�'�&�&�&�&�&�&�&�&�&�&�&�'���� ����������������.�-�-�-�-�-�	��6��?�?�?�
%�%�%�
���	�	�	�	�	�	�	�	�	�
��������������	����J�J�J�J�J�v�J�J�J�? �? �? �? �? �? �? �? �D:$�:$�:$�:$�:$�x�:$�:$�:$�zy�y�y�y�y�'�y�y�y�x	g�g�g�g�g�X�g�g�g�T6�6�6�6�6��"4�6�6�6�r?�?�?�?�?�+�?�?�?�D^+�^+�^+�^+�^+�7�9K�^+�^+�^+�B[�[�[�[�[��[�[�[�z,�,�,�,�,�X�,�,�,�"3�3�3�3�3�#�3�3�3�l%�%�%�%�%�8�%�%�%�nF�nF�nF�nF�nF�(�nF�nF�nF�nF�nFs!�3�A�A�	A�A �A