__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

�ggO����Sr/SQrSSKrSSKJr SSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKJr SSK
Js Jr SSKJrJr SSKJr SrS	rS
rSrSr"S
S\5r"SS\5r"SS\5r"SS5r"SS5r "SS\5r!"SS\!5r""SS\5r#"SS\\ 5r$"SS \ 5r%"S!S"\!\ 5r&"S#S$\5r'"S%S&\5r("S'S(\!5r)"S)S*\5r*"S+S,\5r+g)-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)�iso_strptimez	xmlns:mapz http://www.w3.org/2001/XMLSchemac��SU-$)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_tagr=s
��3�h�>�>�c��S[U5-$)z#Turn a tag name into an XPath path.z./)rrs r�
wadl_xpathrBs���(�8�$�$�$rc�H�0nUHnUcMURU5 M U$)z<Merge any number of dictionaries, some of which may be None.)�update)�dicts�final�dicts   r�_merge_dictsr Gs*���E������L�L�����Lrc��\rSrSrSrSrg)r�PzAAn exception having to do with the state of the WADL application.rN��__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__rrrrrPs��K�rrc��\rSrSrSrSrg)r�Ua-An 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.
rNr#rrrrrUs��rrc��\rSrSrSrSrg)�UnsupportedMediaTypeError�_z�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.
rNr#rrrr-r-_s��rr-c��\rSrSrSrSrg)�WADLBase�gz?A base class for objects that contain WADL-derived information.rNr#rrrr0r0gs��Irr0c�.�\rSrSrSrSSjrSSjrSrg)	�HasParametersMixin�kzAA mixin class for objects that have associated Parameter objects.Nc�0�UcURnUc[S5eURc/$URR[	S55nUc/$UVs/sH/nUR
R
S5U;dM$[X$5PM1 sn$s snf)z6Find subsidiary parameters that have the given styles.z&Could not find any particular resource�param�style)�resource�
ValueError�tag�findallr�attrib�getr)�self�stylesr8�
param_tags�	param_tags     r�params�HasParametersMixin.paramsns������}�}�H����E�F�F��8�8���I��X�X�%�%�j��&9�:�
����I�!+�<�!+�I��#�#�'�'��0�F�:�/�	�(�.�!+�<�	<��<s�#B�Bc���[X$5n0nUGHnURnURbIXr;a6X'UR:wa$[SX'<SU<SUR<S35eURX''URVs/sHo�R
PM n	n[
U	5S:�a6Xr;a1X'U	;a)[SX'<SU<SSRU	5<S	35eU(a$UR(aXr;a[S
U-5eXr;dGMX'XW'X'	GM [
U5S:�a+[SSRUR55-5eU$s snf)
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.
zValue 'z' for parameter 'z' conflicts with fixed value '�'rzInvalid value 'z': valid values are: "z", "�"z$No value for required parameter '%s'zUnrecognized parameter(s): '%s'z', ')
r �name�fixed_valuer9�options�value�len�join�is_required�keys)
r>rB�param_values�enforce_completeness�kw_param_values�validated_valuesr6rG�optionrIs
          r�validate_param_values�(HasParametersMixin.validate_param_values}sf��"$�L�B�����E��:�:�D�� � �,��(�(�.�%�2C�2C�C�$�(4�(:�D�(-�(9�(9�&;�<�<�&+�%6�%6��"�27�-�-�@�-��|�|�-�G�@��G��q� �T�%9�$�*�'�9� �$�*�D�&�+�+�g�2F�"H�I�I�%��):�):��0� �!G�#'�"(�)�)��#�)5�);� �&� �&�-�.�|��q� ��>�%�{�{�<�+<�+<�+>�?�@�A�
A����!As�Er�N)T)r$r%r&r'r(rBrTr)rrrr3r3ks��K�
<� 48�- rr3c�0�\rSrSrSrSrSrSrSrSr	g)	�WADLResolvableDefinition�z=A base class for objects whose definitions may be references.c��SUlXlg)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>r]s  r�__init__�!WADLResolvableDefinition.__init__�s�� ���&�rc���URbUR$UR5nUcXlU$URRU5nUR	U5nUc[SU-5eX0lU$)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.
�No such XML ID: "%s")r\�_get_definition_urlr]�
lookup_xml_id�_definition_factory�KeyError)r>�
object_url�xml_id�
definitions    r�resolve_definition�+WADLResolvableDefinition.resolve_definition�s������'��#�#�#��-�-�/�
��� $���K��!�!�/�/�
�;���-�-�f�5�
����1�J�>�?�?�%���rc��[5e)zhTransform an XML ID into a wadllib wrapper object.

Which kind of object it is depends on the subclass.
��NotImplementedError�r>�ids  rrd�,WADLResolvableDefinition._definition_factory��
��
"�#�#rc��[5e)z]Find the URL that identifies an external reference.

How to do this depends on the subclass.
rl�r>s rrb�,WADLResolvableDefinition._get_definition_url�rqrr[N)
r$r%r&r'r(r^rirdrbr)rrrrXrX�s��G�'� �D$�$rrXc��^�\rSrSrSrSU4Sjjr\S5r\S5r\S5r	SSjr
SrSS	jrSS
jr
SSjr\S5rSS
jrSrSrSrSrSSjrSrSrU=r$)r	��z/A resource, possibly bound to a representation.c�<>�[TU]U5 X l[U[5(a+UR
R
U5RUlOX0lSUlUb�US:XanU(a`[US5(a*[R"UR55UlO:[R"[	U55UlOX@lO[SU-5eXPlUb+UbXplgUR!UR5Ulgg)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/json�decodez?This resource doesn't define a representation for media type %s)�superr^�_url�
isinstance�strr]�get_resource_typer:�representation�hasattr�json�loadsryr-�
media_type�representation_definition�get_representation_definition)	r>r]�url�
resource_typerr��representation_needs_processingr��	__class__s	        �rr^�Resource.__init__�s���*	����%��	��m�S�)�)��'�'�9�9�-�H�L�L�D�H�%�H�"����%��/�/�2��~�x�8�8�.2�j�j�*�1�1�3�/5��+�/3�j�j��^�9L�.M��+�*8�'�/�$�&0�1�2�2�%���%�(�4�1J�.��6�6�t���G��.�	&rc��UR$)z Return the URL to this resource.)r{rss rr��Resource.url$s���y�y�rc�@�URcgURRRS5nUbU$URRRS5nUb>[URR
5R
5n[U5S-U-$g)z@Return the URL to the type definition for this resource, if any.N�typero�#)r:r<r=rr]�
markup_url�ensureSlashr})r>r��type_id�bases    r�type_url�Resource.type_url)s����8�8����h�h�o�o�!�!�&�)���?��J��(�(�/�/�%�%�d�+�����t�'�'�2�2�3�?�?�A�D��t�9�s�?�W�,�,�rc�4�URRS$)zReturn the ID of this resource.ro)r:r<rss rro�Resource.id;s���x�x���t�$�$rc	�^�[URURURXUU5$)a7Bind 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	r]r�r:)r>rr�r�r�s     r�bind�
Resource.bind@s.��"��(�(�$�(�(�D�H�H�&�7�1�3�	3rc���URS5RnUH@nUR5RnURRS5U:XdM>Us $ [
SU-5e)z<Get a description of one of this resource's representations.�GET�	mediaTypez4No definition for representation with media type %s.)�
get_method�responserir:r<r=r-)r>r��default_get_responser�representation_tags     rr��&Resource.get_representation_definitionVst��#���u�5�>�>��2�N�!/�!B�!B�!D�!H�!H��!�(�(�,�,�[�9�Z�G�%�%�3�(�)>�@J�)K�L�	Lrc��UR5HknURRSS5R5nUbXaR5:XdME[	X5nURX#U5(dMiUs $ g)a�Look 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_iterr<r=�lowerr�is_described_by)r>�http_methodr��query_params�representation_params�
method_tagrG�methods        rr��Resource.get_method`sz��0�/�/�1�J��$�$�(�(���4�:�:�<�D��"�d�.?�.?�.A�&A���1���)�)�*�*?�A�A�!�M�
2�rc�B�URU5RU5$)aNA 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_definitionrB�r>r�s  r�
parameters�Resource.parameters�s#���3�3�����t��	%rc�B�URU5RU5$)aRA 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��Resource.parameter_names�s$���3�3���'���-�	.rc#�T# �UR5Hn[X5v� M g7f)z6An iterator over the methods defined on this resource.N)r�r)r>r�s  r�method_iter�Resource.method_iter�s%����/�/�1�J���*�*�2�s�&(c���URU5nURnUR[S55H/nURRS5U:XdM$[
X5s $ g)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.
r6rGN)r�r:r;rr<r=r)r>�
param_namer�rhr�rAs      r�
get_parameter�Resource.get_parameter�sb���9�9�*�E�
�'�^�^��+�3�3�J�w�4G�H�I����#�#�F�+�z�9� ��1�1�I�rc�F�URc[S5eURS:Xa�URS:wa[	SUR-5eURUR
nUbFUR
URUR5up4U[:XaUS;a[U5nU$U$[	S	UR-5e![aI [R"[R"US5SS6nU$![a [U5ef=ff=f)
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.
z,Resource is not bound to any representation.rx�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.)rrr�r7rmrG�_dereference_namespacer:r��XML_SCHEMA_NS_URIrr9�datetime�time�strptime)r>�	parameterrJ�
namespace_url�	data_types     r�get_parameter_value�Resource.get_parameter_value�sC�����&�,�>�@�
@��?�?�0�0����'�)�)��!*���1�2�2��'�'�	���7�E�� �+/�+F�+F��M�M�9�>�>�,3�(�
�!�%6�6�%�)=�=�4� ,�U� 3���L�5�L�!�#G�$(�O�O�#4�5�	5��&�	4�4�$,�$5�$5�"&�-�-��z�"B�1�Q�"G�%J�E��L�� *�4�#-�U�"3�3�	4��	4�s�&C
�
D �+D�D�D c��UbSU;aURSS5up2OSnUR[5nURUS5nXR4$)zxSplits a value into namespace URI and value.

:param tag: A tag to use as context when mapping namespace
names to URIs.
N�:�r�)�splitr=�NS_MAP)r>r:rJ�	namespace�ns_mapr�s      rr��Resource._dereference_namespace�sP�������$�{�{�3��2��I�u��I��������
�
�9�d�3�
��#�#rc�L�URRRU5$)z-Given an ID, find a ResourceType for that ID.)r]�resource_typesr=rns  rrd�Resource._definition_factory�s�����.�.�2�2�2�6�6rc�L�URRRS5$)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:r<r=rss rrb�Resource._get_definition_url�����x�x���"�"�6�*�*rc���URb*URR5nUR5$Ub!URU5nUR5$[	S5e)a�Get 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
zSResource is not bound to any representation, and no media media type was specified.)rr�rir�r)r>r�rhs   rr��(Resource._find_representation_definition�st��*���*��7�7�J�J�L�J��,�,�.�.�
�
#��;�;�J�G�J�
�,�,�.�.�-�,�-�
-rc#�# �UR5RnUR[S55Shv�N gN7f)z+Iterate over this resource's <method> tags.r�N)rir:r;r�r>rhs  rr��Resource._method_tag_iter s2����,�,�.�2�2�
��%�%�j��&:�;�;�;�s�8A�A�A)r{r�rr�r:)NNTN)rxTN)NNNNrV)r$r%r&r'r(r^�propertyr�r�ror�r�r�r�r�r�r�r�r�rdrbr�r�r)�
__classcell__�r�s@rr	r	�s����9�26�15�+/�5I�n��������"�%��%�/A�-1�'+�3�,L�JN�)-��B%�.��+��+�
�&-5�^$�7�+� /�D<�<rr	c��\rSrSrSrSr\S5r\S5r\S5r	\S5r
S
S	jrSS
jrSSjr
Srg)ri&z*A wrapper around an XML <method> tag.
    c�R�XlURRUlX lg)zQInitialize with a <method> tag.

:param method_tag: An ElementTree <method> tag.
N)r8r]r:)r>r8r�s   rr^�Method.__init__)s ��
!�
��=�=�4�4����rc�\�[XRR[S555$)z@Return the definition of a request that invokes the WADL method.�request)�RequestDefinitionr:�findrrss rr��Method.request2s!��!��x�x�}�}�Z�	�5J�'K�L�Lrc�r�[URURR[	S555$)z9Return the definition of the response to the WADL method.r�)rr8r:r�rrss rr��Method.response7s.��"�$�-�-�"&�(�(�-�-�
�:�0F�"G�I�	Irc�L�URRRS5$)z)The XML ID of the WADL method definition.ror�rss rro�	Method.id=s���x�x���"�"�4�(�(rc�h�URRRS5R5$)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:r<r=r�rss rrG�Method.nameBs&���x�x���"�"�6�*�0�0�2�2rNc�<�URR"U40UD6$)�4Return the request URL to use to invoke this method.)r��	build_url)r>rOrQs   r�build_request_url�Method.build_request_urlKs���|�|�%�%�l�F�o�F�Frc�<�URR"X40UD6$)zrBuild a representation to be sent when invoking this method.

:return: A 2-tuple of (media_type, representation).
)r�r)r>r�rOrQs    r�build_representation�Method.build_representationOs&���|�|�*�*��9�(7�9�	9rc���SnUbURRU5nUcgUb=[U5S:�a.URnUcgURURUS5 Ub[U5S:XagUbUR
U5$URRH0nURURUR5US5  g g![
a gf=f![
a MRf=f)a�Returns 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.
NFrT)
r�r�rKrTr�r9r��representationsrBr8)r>r��query_values�representation_valuesrr�s      rr��Method.is_described_byXs��$���!�!�\�\�G�G���N��%���#��L�(9�A�(=��l�l�G����
��-�-��(�(�,��?�
"�)��,�-��2���%�!�1�1�%�'�
'�"�l�l�:�:�N�
��4�4�"�)�)�$�-�-�8�)�5�2��;���'�
��
��"�
��
�s$�C�&,C'�
C$�#C$�'
C5�4C5)r]r8r:rV�NN)NNN)r$r%r&r'r(r^r�r�r�rorGr�r�r�r)rrrrr&s������M��M��I��I�
�)��)��3��3�G�/3�*.�9�=A�.2�5rrc�\�\rSrSrSrSr\S5r\S5rSSjr	SSjr
SS	jrS
rg)
r�i�zBA wrapper around the description of the request invoking a method.c��XlURRUlURRUlX lg)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�r8r]r:)r>r��request_tags   rr^�RequestDefinition.__init__�s1�������,�,��
��=�=�4�4����rc�&�URS/5$)z,Return the query parameters for this method.�query)rBrss rr��RequestDefinition.query_params�s���{�{�G�9�%�%rc#�# �URR[S55H&n[URUR
U5v� M( g7f)Nr)r:r;rrr]r8r�s  rr��!RequestDefinition.representations�sC����(�(�*�*�:�6F�+G�H�J�*�� � �$�-�-��=�
=�I�s�AANc�X�URHnUbURU:XdMUs $ g)z1Return the appropriate representation definition.N)r�r��r>r�rs   rr��/RequestDefinition.get_representation_definition�s0��"�2�2�N��!�^�%>�%>�*�%L�%�%�3�rc�l�URU5nUc[SU-5eUR"U40UD6$)zpBuild a representation to be sent along with this request.

:return: A 2-tuple of (media_type, representation).
z,Cannot build representation of media type %s)r��	TypeErrorr�)r>r�rOrQrhs     rr� RequestDefinition.representation�sF���7�7�
�C�
����J�(�)�*�
*����|�?��?�?rc���UR"URU40UD6nURRn[	U5S:�a2SU;aSnOSnXE[[
UR555--
nU$)r�r�?�&)rTr�r8r�rKr�sorted�items)r>rOrQrRr��appends      rr��RequestDefinition.build_url�s|���5�5����|�@�/>�@���m�m������ �1�$��c�z������I�f�-=�-C�-C�-E�&F�G�G�G�C��
r)r]r�r8r:rVr)
r$r%r&r'r(r^r�r�r�r�rr�r)rrrr�r��sB��L�	��&��&��=��=�
�
@�rr�c�@�\rSrSrSrSSjrSrSrSrSr	S	r
S
rg)ri�z;A wrapper around the description of a response to a method.Nc�J�URUlXlX lX0lg)zWInitialize with a <response> tag.

:param response_tag: An ElementTree <response> tag.
N)r]r8r:�headers)r>r8�response_tagrs    rr^�ResponseDefinition.__init__�s!��
$�/�/��� �
����rc#�# �[S5nURRU5H0n[URR
URU5v� M2 g7f)z�Get an iterator over the representation definitions.

These are the representations returned in response to an
invocation of this method.
rN)rr:r;rr8r])r>�pathr�s   r�__iter__�ResponseDefinition.__iter__�sQ����*�+��"&�(�(�"2�"2�4�"8��*��
�
�)�)�4�=�=�:L�N�
N�#9�s�AAc�D�[URURU5$)zwBind the response to a set of HTTP headers.

A WADL response can have associated header parameters, but no
other kind.
)rr8r:)r>rs  rr��ResponseDefinition.bind�s��"�$�-�-����7�C�Crc���URR[S55HPnURR	S5U:XdM$URR	S5S:XdME[X5s $ g)z,Find a header parameter within the response.r6rGr7�headerN)r:r;rr<r=r)r>r�rAs   rr�� ResponseDefinition.get_parameter�sb�����)�)�*�W�*=�>�I�� � �$�$�V�,�
�:�!�(�(�,�,�W�5��A� ��1�1�?�rc���URc[S5eURS:wa[SUR-5eURR	UR
5$)z:Find the value of a parameter, given the Parameter object.z,Response object is not bound to any headers.r#r�)rrr7rmr=rG)r>r�s  rr��&ResponseDefinition.get_parameter_value�sc���<�<��,�>�@�
@��?�?�h�&�%��&�_�_�-�.�
.��|�|���	���/�/rc�Z�URcgUHnURU:XdMUs $ g)z8Get one of the possible representations of the response.N)r:r�rs   rr��0ResponseDefinition.get_representation_definitions2���8�8���"�N��(�(�J�6�%�%�#�r)r]rr8r:rV)r$r%r&r'r(r^rr�r�r�r�r)rrrrr�s%��E��	N�D��	0�rrc�|^�\rSrSrSrU4SjrU4SjrSr\S5r	Sr
SrSS	jrS
r
SrSrS
rSrU=r$)riz2A definition of the structure of a representation.c�<>�[TU]U5 X lX0lgrV)rzr^r8r:)r>r]r8r�r�s    �rr^�!RepresentationDefinition.__init__s���
����%� �
�%�rc�(>�[TU]SS/U5$)Nrr�)rzrB)r>r8r�s  �rrB�RepresentationDefinition.paramss����w�~�w��0�(�;�;rc�b�URU5Vs/sHo"RPM sn$s snf)z#Return the names of all parameters.)rBrG)r>r8r6s   rr��(RepresentationDefinition.parameter_namess'��(,���H�(=�>�(=�u�
�
�(=�>�>��>s�,c�P�UR5RRS$)z4The media type of the representation described here.r�)rir:r<rss rr��#RepresentationDefinition.media_types$���&�&�(�,�,�3�3�K�@�@rc��[[[RS-
55nSU-n[R
"[R5nSX4--S-nUcU$UnSnS[R"U5-S-RS5n[R"X�[RS	9(dU$US
-[U5-nUS-
nMn)z;Make a random boundary that does not appear in `all_parts`.r�z%%0%ddz===============z==rz^--z(--)?$�ascii)�flags�.)rK�repr�sys�maxsize�random�	randrange�re�escape�encode�search�	MULTILINEr})	r>�	all_parts�_width�_fmt�token�boundary�b�counter�patterns	         r�_make_boundary�'RepresentationDefinition._make_boundarys����T�#�+�+��/�*�+���&� ��� � ����-�����.��5�����O�������r�y�y��|�+�h�6�>�>�w�G�G��9�9�W�r�|�|�D�����3���W��-�A��q�L�G�rc��UHgup4URURS55 URS5 URURS55 URS5 Mi URS5 g)z$Write MIME headers to a file object.�UTF-8s: �
N��writer=)r>�bufr�keyrJs     r�_write_headers�'RepresentationDefinition._write_headers1s^��!�J�C��I�I�c�j�j��)�*��I�I�e���I�I�e�l�l�7�+�,��I�I�g��	"�
	�	�	�'�rc��URS5 URURS55 U(aURS5 URS5 g)z,Write a multipart boundary to a file object.s--rKrLNrM)r>rOrD�closings    r�_write_boundary�(RepresentationDefinition._write_boundary:s>���	�	�%���	�	�(�/�/�'�*�+���I�I�e���	�	�'�rc�f�/nUGHsup4n[R"5nU(a SnS[U5<S[U5<S3nOSnS[U5-nURUSSU4S	U4/5 U(a>[	U[
5(d[
S
[U5-5eURU5 O�[	U[5(d[
S[U5-5e[R"SU5n	U	S
SH4n
URU
RS55 URS5 M6 URU	SRS55 URUR55 GMv URSR!U55n[R"5nS[U5-nURUSSU4/5 UH6nUR#Xk5 URU5 URS5 M8 UR#XkSS9 XvR54$)a
Generate 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")zMIME-Versionz1.0zContent-TypezContent-Dispositionzbytes payload expected: %szstring payload expected: %sz
\r\n|\r|\nN���rKrLz"multipart/form-data; boundary="%s"T)rT)�io�BytesIOr
rQr|�bytesrr�rNr}r;r�r=r�getvaluerHrLrU)
r>�parts�
encoded_parts�	is_binaryrGrJrO�ctype�cdisp�lines�linerD�encoded_parts
             r�_generate_multipart_form�1RepresentationDefinition._generate_multipart_formBs����
�&+�"�I�U��*�*�,�C��2���$�K��t��.��6��.��t��<������'���'�&��.�&�
�
�!�%��/�/�#�$@�4��;�$N�O�O��	�	�%� �!�%��-�-�#�5��U��C�E�E������6��!�#�2�J�D��I�I�d�k�k�'�2�3��I�I�g�&�'��	�	�%��)�*�*�7�3�4�� � �����0�?',�D�&�&�w�|�|�M�'B�C���j�j�l��4�u�X��F�����C�#�
�U�#�"�	�*�L�� � ��/��I�I�l�#��I�I�g��*�	
���S�D��9��l�l�n�$�$rc�B�UR5nURUR5nUR"XA40UD6nURnUS:Xa%[[
UR555nXg4$US:Xax/n[5n	UHPn
URU
RU	5nX�LdM%URU
RS:HU
RU45 MR URU5upgXg4$US:Xa[R"U5nXg4$[!SU-5e)zjBind the definition to parameter values, creating a document.

:return: A 2-tuple (media_type, document).
z!application/x-www-form-urlencodedzmultipart/form-data�binaryrxzUnsupported media type: '%s')rirBr8rTr�rrr�objectr=rGrr�rer��dumpsr9)r>rOrQrhrBrRr��docr]�missingr6rJs            rr��RepresentationDefinition.bind�s)��
�,�,�.�
��"�"�4�=�=�1���5�5��5�$3�5���_�_�
��<�<��F�#3�#9�#9�#;�<�=�C�����0�
0��E��h�G���(�,�,�U�Z�Z��A���'��L�L�%�*�*��"8�%�*�*�e�!L�M� �#�;�;�E�B�O�J�
���	�-�
-��*�*�-�.�C�����;�j�H�I�Irc�L�URRRU5$)z9Turn a representation ID into a RepresentationDefinition.)r]�representation_definitionsr=rns  rrd�,RepresentationDefinition._definition_factory�s�����:�:�>�>�r�B�Brc�L�URRRS5$)z�Find 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�rss rrb�,RepresentationDefinition._get_definition_url�r�r)r8r:)F)r$r%r&r'r(r^rBr�r�r�rHrQrUrer�rdrbr)r�r�s@rrrsV���<�&�
<�?��A��A��$��@%�D�4C�+�+rrc��\rSrSrSrSr\S5r\S5r\S5r	\S5r
\S5rS	r\S
5r
\S5r\S5rS
rg)ri�z5One of the parameters of a representation definition.c�>�URUlXlX lg)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)r]�value_containerr:)r>rvr:s   rr^�Parameter.__init__�s��+�6�6���.���rc�L�URRRS5$)zThe name of this parameter.rGr�rss rrG�Parameter.name�����x�x���"�"�6�*�*rc�L�URRRS5$)zThe style of this parameter.r7r�rss rr7�Parameter.style�s���x�x���"�"�7�+�+rc�L�URRRS5$)zThe XSD type of this parameter.r�r�rss rr��Parameter.type�rzrc�L�URRRS5$)aThe 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�rss rrH�Parameter.fixed_value�s���x�x���"�"�7�+�+rc�p�URRRSS5R5S;$)z6Whether or not a value for this parameter is required.�required�false)�1�truer�rss rrM�Parameter.is_required�s2�������#�#�J��8�>�>�@� �!�	"rc�8�URRU5$)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.
)rvr�rss r�	get_value�Parameter.get_value�s���#�#�7�7��=�=rc��URR[S55Vs/sHn[X5PM sn$s snf)z7Return the set of acceptable values for this parameter.rS)r:r;r�Option)r>�
option_tags  rrI�Parameter.options�sF��#'�(�(�"2�"2�:�h�3G�"H�J�"H�J��t�(�"H�J�	J��Js�?c�h�URR[S55nUcg[X5$)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  rr��Parameter.link�s/���8�8�=�=��F�!3�4������D�#�#rc�N�URnUc[S5eUR$)z�Follow 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.
z(This parameter isn't a link to anything.)r�r9�follow)r>r�s  r�linked_resource�Parameter.linked_resource�s(���y�y���<��G�H�H��{�{�r)r]r:rvN)r$r%r&r'r(r^r�rGr7r�rHrMr�rIr�r�r)rrrrr�s���?���+��+��,��,��+��+��,��,��"��"�
>��J��J�
�$��$����rrc�.�\rSrSrSrSr\S5rSrg)r�i
z0One of a set of possible values for a parameter.c��XlX lg)zeInitialize the option.

:param parameter: A Parameter.
:param link_tag: An ElementTree <option> tag.
N�r�r:)r>r�r�s   rr^�Option.__init__
s��#���rc�L�URRRS5$)NrJr�rss rrJ�Option.values���x�x���"�"�7�+�+rr�N)	r$r%r&r'r(r^r�rJr)rrrr�r�
s��:���,��,rr�c�X^�\rSrSrSrU4Sjr\S5r\S5rSr	Sr
SrU=r$)	riz�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�P>�[TU]UR5 XlX lg)zaInitialize the link.

:param parameter: A Parameter.
:param link_tag: An ElementTree <link> tag.
N)rzr^r]r�r:)r>r�r�r�s   �rr^�
Link.__init__"s"���	����.�.�/�"���rc�Z�UR(d[S5eUR5$)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_followrrirss rr��Link.follow,s.������.�/�
/��&�&�(�(rc�F�UR5 g![a gf=f)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)rbrrss rr��Link.can_follow5s,��	��$�$�&����	��	�s��
 � c��[URURR5URRRU5R5$)z,Turn a resource type ID into a ResourceType.)r	r]r�r�r�r=r:rns  rrd�Link._definition_factoryBsG������d�n�n�6�6�8����+�+�/�/��3�7�7�9�	9rc�l�URRRS5nUc[S5eU$)z(Find the URL containing the definition .r�zIParameter is a link, but not to a resource with a known WADL description.)r:r<r=r)r>r�s  rrb�Link._get_definition_urlHs6���x�x���"�"�?�3���<��=�>�
>��rr�)
r$r%r&r'r(r^r�r�r�rdrbr)r�r�s@rrrsD������)��)��
��
�9��rrc��\rSrSrSrSrSrg)r
iQz,A wrapper around an XML <resource_type> tag.c��Xlg)zfInitialize with a <resource_type> tag.

:param resource_type_tag: An ElementTree <resource_type> tag.
N�r:)r>�resource_type_tags  rr^�ResourceType.__init__Ts	��
%�rr�N)r$r%r&r'r(r^r)rrrr
r
Qs
��6�%rr
c�<�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)ri\z1A WADL document made programmatically accessible.c��Xl[US5(aURU5UlOUR	U5UlURR[
S55UlURRRS5Ul
0Ul0UlURR[
S55H>nURRS5nUcM#[USU5nXPRU'M@ URR[
S55H*nURSn[U5URU'M, g)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�rroNr�)r�r��_from_streamrk�_from_stringr�rr�r<r=�
resource_baseror�r;rr
)r>r��markuprrorhr�s       rr^�Application.__init___s ��%���6�6�"�"��(�(��0�D�H��(�(��0�D�H������z�+�'>�?���!�^�^�2�2�6�6�v�>���*,��'� ���"�h�h�.�.�z�:J�/K�L�N��&�&�*�*�4�0�B��~�5��$��0�
�6@�/�/��3�M�"�X�X�-�-�j��.I�J�M��%�%�d�+�B�&2�=�&A�D����#�Krc�2�SnSn/n[R"X5HbupVUS:XaURU5 MUS:XaUR5 M6US:XdM>UcUnUR	[
[
U55 Md [R"U5$)zbTurns markup into a document.

Just a wrapper around ElementTree which keeps track of namespaces.
)�start�start-ns�end-nsNr�r�r�)�ET�	iterparser�pop�setr�r�ElementTree)r>�stream�events�rootr��event�elems       rr��Application._from_streamxs���
/�������<�<��7�K�E��
�"��
�
�d�#��(�"��
�
���'�!��<��D������f��.�8��~�~�d�#�#rc��[U[5(dURS5nUR[R
"U55$)zTurns markup into a document.rK)r|r[r=r�rYrZ)r>r�s  rr��Application._from_string�s7���&�%�(�(��]�]�7�+�F�� � ����F�!3�4�4rc��URU5nURRU5nUc[SU-5eU$)z7Retrieve a resource type by the URL of its description.ra)rcr�r=re)r>�resource_type_urlrgr�s    rr~�Application.get_resource_type�sG���#�#�$5�6���+�+�/�/��7�
�� ��1�4E�E�F�F��rc�(�[UR5R5nSUlUR	S5(a[U5R5nOURU5nURnSUlX2:XaU$[
SU-5e)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�resolverm)r>r��
markup_uri�this_uri�possible_xml_ids     rrc�Application.lookup_xml_id�s�������)�7�7�9�
�"�
���>�>�&�!�!��3�x�-�-�/�H�"�)�)�#�.�H�"�+�+�� ����!�#�"�"�#-�/2�#3�4�	4rc��URVs/sHnURSU:XdMUPM nn[U5S:ag[U5S:�a[SU-5e[	U[URUS5US5$s snf)z`Locate one of the resources described by this document.

:param path: The path to the resource.
rr�Nz+More than one resource defined with path %sTr)r�r<rKrr	rr�)r>rr8�matchings    r�get_resource_by_path� Application.get_resource_by_path�s���.2�^�^�8�^�����v�.�$�6��^��8��x�=�1����x�=�1���I�"�#�$�
$���%��*�*�D�$�7��!��F�	F��8s
�B�B)rkr�ror�r�r�N)r$r%r&r'r(r^r�r�r~rcr�r)rrrrr\s&��;�B�2$�(5��4�@Frr),r(�__all__r��email.utilsr
rYr�r9r;r7r��urllib.parser�xml.etree.ElementTree�etreer�r��lazr.urirr�wadllib.iso_strptimerr�r�rrr �	Exceptionrrr-r0r3rXr	rr�rrrr�rr
rrrr�<module>r�s1��"
�����	��
�	�
��"�"�"��-�	��6��?�
%�
�	�	�	�
����	��J�J�? �? �D:$�x�:$�zy<�'�y<�x	g�X�g�T6��"4�6�r?�+�?�D^+�7�9K�^+�B[��[�|,�X�,�"3�#�3�l%�8�%�nF�(�nFr

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 310 B 0644
application.cpython-313.pyc File 53.36 KB 0644
iso_strptime.cpython-313.pyc File 3.96 KB 0644
Filemanager