+
    :¬hO»  ã                   ó
  € R t . R+Ot^ RIt^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIHt ^ RIHu Ht ^ RIHtHt ^ RIHt RtRtR tR tR t ! R R
]4      t ! R R]4      t ! R R]4      t ! R R4      t ! R R4      t  ! R R]4      t! ! R R]!4      t" ! R  R]4      t# ! R! R"]] 4      t$ ! R# R] 4      t% ! R$ R]!] 4      t& ! R% R]4      t' ! R& R']4      t( ! R( R]!4      t) ! R) R	]4      t* ! R* R]4      t+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                ó   € RV ,           # )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\        V 4      ,           # )z#Turn a tag name into an XPath path.z./)r   r   s   &r   Ú
wadl_xpathr   B   s   € à”(˜8Ó$Õ$Ð$r   c                 óJ   € / pV  F  pVf   K	  VP                  V4       K  	  V# )z<Merge any number of dictionaries, some of which may be None.)Úupdate)ÚdictsÚfinalÚdicts   *  r   Ú_merge_dictsr   G   s*   € à€EÛˆØÔØ�L‰L˜Öñ ð €Lr   c                   ó   € ] tR t^PtRtRtR# )r   zAAn exception having to do with the state of the WADL application.r   N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   r   r   r   r   P   s   † ÙKÛr   c                   ó   € ] tR t^UtRtRtR# )r   a-  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.
r   Nr!   r   r   r   r   r   U   s   † õr   c                   ó   € ] tR t^_tRtRtR# )Ú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.
r   Nr!   r   r   r   r*   r*   _   s   † õr   r*   c                   ó   € ] tR t^gtRtRtR# )ÚWADLBasez?A base class for objects that contain WADL-derived information.r   Nr!   r   r   r   r,   r,   g   s   † ÝIr   r,   c                   ó8   a € ] tR t^kt o RtRR ltRR ltRtV tR# )ÚHasParametersMixinzAA mixin class for objects that have associated Parameter objects.Nc                ó8  € Vf   V P                   pVf   \        R4      hV P                  f   . # V P                  P                  \	        R4      4      pVf   . # V Uu. uF0  pVP
                  P                  R4      V9   g   K%  \        W$4      NK2  	  up# u upi )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.paramsn   s›   € àÒØ—}‘}ˆHØÒÜÐEÓFÐFØ�8‰8ÒØˆIØ—X‘X×%Ñ%¤j°Ó&9Ó:ˆ
ØÒØˆIá!+ó<Ù!+�IØ×#Ñ#×'Ñ'¨Ó0°FÑ:ô /”	˜(Ö.Ù!+ñ<ð 	<ùò <s   Á"BÂBc                ó  € \        W$4      p/ pV EF,  pVP                  pVP                  eT   Wr9   d@   W',          VP                  8w  d)   \        RW',          : RV: RVP                  : R24      hVP                  W'&   VP                   Uu. uF  qˆP
                  NK  	  p	p\        V	4      ^ 8”  dA   Wr9   d;   W',          V	9  d.   \        RW',          : RV: RRP                  V	4      : R24      hV'       d+   VP                  '       d   Wr9  d   \        R	V,          4      hWr9   g   EK   W',          WW&   W' EK/  	  \        V4      ^ 8”  d0   \        R
RP                  VP                  4       4      ,          4      hV# u upi )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.
zValue 'z' for parameter 'z' conflicts with fixed value 'Ú'zInvalid value 'z': valid values are: "z", "Ú"z$No value for required parameter '%s'zUnrecognized parameter(s): '%s'z', ')
r   ÚnameÚfixed_valuer3   ÚoptionsÚvalueÚlenÚjoinÚis_requiredÚkeys)
r8   r<   Úparam_valuesÚenforce_completenessÚkw_param_valuesÚvalidated_valuesr0   rA   ÚoptionrC   s
   &&&&,     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àÐùò! As   ÂFr   ©N)T)	r"   r#   r$   r%   r&   r<   rN   r'   Ú__classdictcell__©Ú__classdict__s   @r   r.   r.   k   s   ø‡ € ÙKô<÷- ò - r   r.   c                   ó<   a € ] tR t^­t o RtR tR tR tR tRt	V t
R# )ÚWADLResolvableDefinitionz=A base class for objects whose definitions may be references.c                ó    € RV n         Wn        R# )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)r8   rY   s   &&r   Ú__init__Ú!WADLResolvableDefinition.__init__°   s   € ð  ˆÔØ&Ör   c                ó  € V P                   e   V P                   # V P                  4       pVf	   W n         V # V P                  P                  V4      pV P	                  V4      pVf   \        RV,          4      hW0n         V# )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Õ>Ó?Ð?Ø%ÔØÐr   c                ó   € \        4       h)zhTransform an XML ID into a wadllib wrapper object.

Which kind of object it is depends on the subclass.
©ÚNotImplementedError©r8   Úids   &&r   r`   Ú,WADLResolvableDefinition._definition_factoryÛ   ó   € ô
 "Ó#Ð#r   c                ó   € \        4       h)z]Find the URL that identifies an external reference.

How to do this depends on the subclass.
rh   ©r8   s   &r   r^   Ú,WADLResolvableDefinition._get_definition_urlâ   rm   r   rW   N)r"   r#   r$   r%   r&   rZ   re   r`   r^   r'   rQ   rR   s   @r   rU   rU   ­   s"   ø‡ € ÙGò'ò òD$÷$ð $r   rU   c                   óÚ   a a€ ] tR t^êt oRtRV 3R llt]R 4       t]R 4       t]R 4       t	RR lt
R tRR ltRR	 ltRR
 lt]R 4       tRR ltR tR tR tR tRR ltR tRtVtV ;t# )r	   z/A resource, possibly bound to a representation.c                óX  <€ \         SV `  V4       W n        \        V\        4      '       d,   V P
                  P                  V4      P                  V n        MW0n        RV n        VeŠ   VR8X  dq   V'       db   \        VR4      '       d+   \        P                  ! VP                  4       4      V n        M>\        P                  ! \	        V4      4      V n        MW@n        M\        RV,          4      hWPn        Ve/   Ve	   Wpn        R# V P!                  V P                  4      V n        R# 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Úloadsrt   r*   Ú
media_typeÚrepresentation_definitionÚget_representation_definition)	r8   rY   ÚurlÚresource_typerz   r~   Úrepresentation_needs_processingr   Ú	__class__s	   &&&&&&&&€r   rZ   Ú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ð Ö.ñ	 &r   c                ó   € V P                   # )z Return the URL to this resource.)rv   ro   s   &r   r�   ÚResource.url$  s   € ð �y‰yÐr   c                óZ  € V P                   f   R# V P                   P                  P                  R4      pVe   V# V P                   P                  P                  R4      pVeG   \        V P                  P
                  4      P                  4       p\        V4      R,           V,           # R# )z@Return the URL to the type definition for this resource, if any.NÚtyperk   Ú#)r4   r6   r7   r   rY   Ú
markup_urlÚensureSlashrx   )r8   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Õ,Ð,ñ r   c                ó<   € V P                   P                  R,          # )zReturn the ID of this resource.rk   )r4   r6   ro   s   &r   rk   ÚResource.id;  s   € ð �x‰x�‰˜tÕ$Ð$r   c           	     ó^   € \        V P                  V P                  V P                  WVV4      # )a7  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	   rY   r�   r4   )r8   rz   r~   rƒ   r   s   &&&&&r   ÚbindÚResource.bind@  s.   € ô" ˜×(Ñ(¨$¯(©(°D·H±HØ&Ø7Ø1ó3ð 	3r   c                óê   € V P                  R4      P                  pV FA  pVP                  4       P                  pVP                  P                  R4      V8X  g   K?  Vu # 	  \        RV,          4      h)z<Get a description of one of this resource's representations.ÚGETÚ	mediaTypez4No definition for representation with media type %s.)Ú
get_methodÚresponsere   r4   r6   r7   r*   )r8   r~   Údefault_get_responserz   Úrepresentation_tags   &&   r   r€   Ú&Resource.get_representation_definitionV  st   € à#Ÿ™¨uÓ5×>Ñ>ÐÛ2ˆNØ!/×!BÑ!BÓ!D×!HÑ!HÐØ!×(Ñ(×,Ñ,¨[Ó9¸ZÖGØ%Ò%ñ 3ô (ð )>Ø@Jõ)Kó Lð 	Lr   c                ó
  € V P                  4        Fn  pVP                  P                  RR4      P                  4       pVe   WaP                  4       8X  g   KG  \	        W4      pVP                  W#V4      '       g   Kl  Vu # 	  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_iterr6   r7   Úlowerr   Úis_described_by)r8   Úhttp_methodr~   Úquery_paramsÚrepresentation_paramsÚ
method_tagrA   Úmethods   &&&&&   r   r™   ÚResource.get_method`  sz   € ð0 ×/Ñ/Ö1ˆJØ×$Ñ$×(Ñ(¨°Ó4×:Ñ:Ó<ˆDØÒ" d×.?Ñ.?Ó.AÖ&AÜ Ó1�Ø×)Ñ)¨*Ø*?÷Aô Aà!’Mñ 2ñ r   c                óB   € V P                  V4      P                  V 4      # )aN  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<   ©r8   r~   s   &&r   Ú
parametersÚResource.parameters�  s#   € ð ×3Ñ3Øóß™˜t›ð	%r   c                óB   € V P                  V4      P                  V 4      # )aR  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   &&r   r¯   ÚResource.parameter_namesŽ  s$   € ð ×3Ñ3Øóß'™¨Ó-ð	.r   c              #  óV   "  € V P                  4        F  p\        W4      x € K  	  R# 5i)z6An iterator over the methods defined on this resource.N)r    r   )r8   r¦   s   & r   Úmethod_iterÚResource.method_iter›  s%   é € ð ×/Ñ/Ö1ˆJÜ˜Ó*Ô*ó 2ùs   ‚')c                óÜ   € V P                  V4      pVP                  pVP                  \        R4      4       F0  pVP                  P                  R4      V8X  g   K%  \        W4      u # 	  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.
r0   rA   N)rª   r4   r5   r   r6   r7   r   )r8   Ú
param_namer~   rd   rœ   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ñ r   c                óx  € V P                   f   \        R4      hV P                  R8X  d™   VP                  R8w  d   \	        RVP                  ,          4      hV P                   VP
                  ,          pVeI   V P                  VP                  VP                  4      w  r4V\        8X  d   VR9   d    \        V4      pV# V# \	        RV P                  ,          4      h  \         dP     \        P                  ! \        P                  ! TR4      R,          !  p T#   \         d    \        T4      hi ; ii ; 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)rz   r   r~   r1   ri   rA   Ú_dereference_namespacer4   r‰   ÚXML_SCHEMA_NS_URIr   r3   Ú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   Â4C ÃD9Ã+0DÄD5Ä5D9c                óš   € Ve   RV9   d   VP                  R^4      w  r2MRpVP                  \        4      pVP                  VR4      pWR3# )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)r8   r4   rD   Ú	namespaceÚns_maprÅ   s   &&&   r   r¿   ÚResource._dereference_namespaceã  sP   € ð Ò ¨¤Ø$Ÿ{™{¨3°Ó2ÑˆI�uàˆIØ—‘œ“ˆØŸ
™
 9¨dÓ3ˆØÐ#Ð#r   c                óL   € V P                   P                  P                  V4      # )z-Given an ID, find a ResourceType for that ID.)rY   Úresource_typesr7   rj   s   &&r   r`   ÚResource._definition_factoryñ  s   € à×Ñ×.Ñ.×2Ñ2°2Ó6Ð6r   c                óL   € V P                   P                  P                  R4      # )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‰   ©r4   r6   r7   ro   s   &r   r^   ÚResource._get_definition_urlõ  ó   € ð �x‰x�‰×"Ñ" 6Ó*Ð*r   c                óÒ   € V P                   e+   V P                  P                  4       pVP                  4       # Ve"   V P                  V4      pVP                  4       # \	        R4      h)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.)rz   r   re   r€   r   )r8   r~   rd   s   && r   rª   Ú(Resource._find_representation_definitionþ  st   € ð* ×ÑÒ*ð ×7Ñ7×JÑJÓLˆJð ×,Ñ,Ó.Ð.ð Ò#Ø×;Ñ;¸JÓGˆJð
 ×,Ñ,Ó.Ð.ô -ð,ó-ð -r   c              #  óŠ   "  € V P                  4       P                  pVP                  \        R4      4       Rj  x€L
  R#  L5i)z+Iterate over this resource's <method> tags.r§   N)re   r4   r5   r   ©r8   rd   s   & r   r    ÚResource._method_tag_iter   s2   é € à×,Ñ,Ó.×2Ñ2ˆ
Ø×%Ñ%¤j°Ó&:Ó;×;Ô;ùs   ‚8AºA»A)rv   r~   rz   r   r4   )NNTN)rs   TN)NNNNrP   )r"   r#   r$   r%   r&   rZ   Úpropertyr�   r�   rk   r”   r€   r™   r¬   r¯   r²   r¶   rÇ   r¿   r`   r^   rª   r    r'   rQ   Ú__classcell__©r„   rS   s   @@r   r	   r	   ê   s¤   ù‡ € Ù9÷5Iðn ñó ðð ñó ðð" ñ%ó ð%ô3ò,LôôB%ô.ð ñ+ó ð+ô
ò&-5ò^$ò7ò+ô /÷D<ò <r   c                   óˆ   a € ] tR tRt o RtR t]R 4       t]R 4       t]R 4       t	]R 4       t
RR	 ltRR
 ltRR ltRtV tR# )r   i&  z*A wrapper around an XML <method> tag.
    c                óT   € Wn         V P                   P                  V n        W n        R# )zQInitialize with a <method> tag.

:param method_tag: An ElementTree <method> tag.
N)r2   rY   r4   )r8   r2   r¦   s   &&&r   rZ   ÚMethod.__init__)  s    € ð
 !ŒØŸ=™=×4Ñ4ˆÔØŽr   c                ó\   € \        W P                  P                  \        R4      4      4      # )z@Return the definition of a request that invokes the WADL method.Úrequest)ÚRequestDefinitionr4   Úfindr   ro   s   &r   rã   ÚMethod.request2  s!   € ô ! §x¡x§}¡}´ZÀ	Ó5JÓ'KÓLÐLr   c                ór   € \        V P                  V P                  P                  \	        R4      4      4      # )z9Return the definition of the response to the WADL method.rš   )r   r2   r4   rå   r   ro   s   &r   rš   ÚMethod.response7  s.   € ô " $§-¡-Ø"&§(¡(§-¡-´
¸:Ó0FÓ"GóIð 	Ir   c                óL   € V P                   P                  P                  R4      # )z)The XML ID of the WADL method definition.rk   rÔ   ro   s   &r   rk   Ú	Method.id=  s   € ð �x‰x�‰×"Ñ" 4Ó(Ð(r   c                óh   € V P                   P                  P                  R4      P                  4       # )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   ©r4   r6   r7   r¡   ro   s   &r   rA   ÚMethod.nameB  s&   € ð �x‰x�‰×"Ñ" 6Ó*×0Ñ0Ó2Ð2r   Nc                ó<   € V P                   P                  ! V3/ VB # )ú4Return the request URL to use to invoke this method.)rã   Ú	build_url)r8   rI   rK   s   &&,r   Úbuild_request_urlÚMethod.build_request_urlK  s   € à�|‰|×%Ò% lÑF°oÑFÐFr   c                ó<   € V P                   P                  ! W3/ VB # )zrBuild a representation to be sent when invoking this method.

:return: A 2-tuple of (media_type, representation).
)rã   rz   )r8   r~   rI   rK   s   &&&,r   Úbuild_representationÚMethod.build_representationO  s&   € ð �|‰|×*Ò*Øñ9Ø(7ñ9ð 	9r   c                ó  € RpVe"   V P                   P                  V4      pVf   R# VeA   \        V4      ^ 8”  d1   V P                   pVf   R#  VP                  VP                  VR4       Ve   \        V4      ^ 8X  d   R# Ve   VP                  V4      # V P                   P                   F1  p VP                  VP                  V P                  4      VR4        R# 	  R#   \
         d     R# i ; i  \
         d     KW  i ; 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€   rE   rN   r¤   r3   r¢   Úrepresentationsr<   r2   )r8   r~   Úquery_valuesÚrepresentation_valuesrz   rã   s   &&&&  r   r¢   ÚMethod.is_described_byX  s  € ð$ ˆØÒ!Ø!Ÿ\™\×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Ã2C3Ã6DÄD)rY   r2   r4   rP   ©NN)NNN)r"   r#   r$   r%   r&   rZ   rÜ   rã   rš   rk   rA   rñ   rô   r¢   r'   rQ   rR   s   @r   r   r   &  sx   ø‡ € ñòð ñMó ðMð ñIó ðIð
 ñ)ó ð)ð ñ3ó ð3ôGô9÷5ò 5r   c                   óh   a € ] tR tRt o RtR t]R 4       t]R 4       tRR lt	RR lt
RR	 ltR
tV tR# )rä   i�  zBA wrapper around the description of the request invoking a method.c                óŠ   € Wn         V P                   P                  V n        V P                  P                  V n        W n        R# )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§   r2   rY   r4   )r8   r§   Úrequest_tags   &&&r   rZ   ÚRequestDefinition.__init__’  s1   € ð ŒØŸ™×,Ñ,ˆŒØŸ=™=×4Ñ4ˆÔØŽr   c                ó&   € V P                  R.4      # )z,Return the query parameters for this method.Úquery)r<   ro   s   &r   r¤   ÚRequestDefinition.query_params�  s   € ð �{‰{˜G˜9Ó%Ð%r   c              #  óª   "  € V P                   P                  \        R 4      4       F&  p\        V P                  V P
                  V4      x € K(  	  R# 5i)rz   N)r4   r5   r   r   rY   r2   rÚ   s   & r   r÷   Ú!RequestDefinition.representations¢  sC   é € àŸ(™(×*Ñ*¬:Ð6FÓ+GÖHˆJÜ*Ø× Ñ  $§-¡-°ó=ô =ó Iùs   ‚AANc                ó^   € V P                    F  pVe   VP                  V8X  g   K  Vu # 	  R# )z1Return the appropriate representation definition.N)r÷   r~   ©r8   r~   rz   s   && r   r€   Ú/RequestDefinition.get_representation_definition¨  s0   € à"×2Ô2ˆNØÒ! ^×%>Ñ%>À*Ö%LØ%Ò%ñ 3ñ r   c                óv   € V P                  V4      pVf   \        RV,          4      hVP                  ! V3/ VB # )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”   )r8   r~   rI   rK   rd   s   &&&, r   rz   Ú RequestDefinition.representation¯  sF   € ð ×7Ñ7¸
ÓCˆ
ØÒÜÐJØ(õ)ó *ð *à�Š˜|Ñ?¨Ñ?Ð?r   c                ó  € V P                   ! V P                  V3/ VB pV P                  P                  p\	        V4      ^ 8”  d<   RV9   d   RpMRpWE\        \        VP                  4       4      4      ,           ,          pV# )rï   Ú?Ú&)rN   r¤   r2   r�   rE   r   ÚsortedÚitems)r8   rI   rK   rL   r�   Úappends   &&,   r   rð   ÚRequestDefinition.build_url»  s|   € à×5Ò5Ø×Ñ˜|ñ@Ø/>ñ@Ðà�m‰m×ÑˆÜÐÓ  1Ô$Ø�cŒzØ‘à�ØœI¤fÐ-=×-CÑ-CÓ-EÓ&FÓGÕGÕGˆCØˆ
r   )rY   r§   r2   r4   rP   rû   )r"   r#   r$   r%   r&   rZ   rÜ   r¤   r÷   r€   rz   rð   r'   rQ   rR   s   @r   rä   rä   �  sJ   ø‡ € ÙLò	ð ñ&ó ð&ð ñ=ó ð=ô
ô
@÷ò r   rä   c                   óL   a € ] tR tRt o RtRR ltR tR tR tR t	R	 t
R
tV tR# )r   iÉ  z;A wrapper around the description of a response to a method.Nc                óL   € VP                   V n         Wn        W n        W0n        R# )zWInitialize with a <response> tag.

:param response_tag: An ElementTree <response> tag.
N)rY   r2   r4   Úheaders)r8   r2   Úresponse_tagr  s   &&&&r   rZ   ÚResponseDefinition.__init__Ñ  s!   € ð
 $×/Ñ/ˆÔØ ŒØŒØŽr   c              #  óÂ   "  € \        R4      pV P                  P                  V4       F0  p\        V P                  P
                  V P                  V4      x € K2  	  R# 5i)zŠGet an iterator over the representation definitions.

These are the representations returned in response to an
invocation of this method.
rz   N)r   r4   r5   r   r2   rY   )r8   Úpathrœ   s   &  r   Ú__iter__ÚResponseDefinition.__iter__Û  sQ   é € ô Ð*Ó+ˆØ"&§(¡(×"2Ñ"2°4Ö"8ÐÜ*Ø—‘×)Ñ)¨4¯=©=Ð:LóNô Nó #9ùs   ‚AAc                óD   € \        V P                  V P                  V4      # )zwBind the response to a set of HTTP headers.

A WADL response can have associated header parameters, but no
other kind.
)r   r2   r4   )r8   r  s   &&r   r”   ÚResponseDefinition.bindæ  s   € ô " $§-¡-°·±¸7ÓCÐCr   c                óú   € V P                   P                  \        R4      4       FR  pVP                  P	                  R4      V8X  g   K%  VP                  P	                  R4      R8X  g   KG  \        W4      u # 	  R# )z,Find a header parameter within the response.r0   rA   r1   ÚheaderN)r4   r5   r   r6   r7   r   )r8   rµ   r;   s   && r   r¶   Ú ResponseDefinition.get_parameterî  sb   € àŸ™×)Ñ)¬*°WÓ*=Ö>ˆIØ× Ñ ×$Ñ$ VÓ,°
Ö:Ø!×(Ñ(×,Ñ,¨WÓ5¸ÖAÜ  Ó1Ò1ñ ?ñ r   c                óØ   € V P                   f   \        R4      hVP                  R8w  d   \        RVP                  ,          4      hV P                   P	                  VP
                  4      # )z:Find the value of a parameter, given the Parameter object.z,Response object is not bound to any headers.r  rº   )r  r   r1   ri   r7   rA   )r8   rÄ   s   &&r   rÇ   Ú&ResponseDefinition.get_parameter_valueö  sc   € à�<‰<ÒÜ,Ø>ó@ð @à�?‰?˜hÔ&Ü%ðØ&Ÿ_™_õ-ó.ð .ð �|‰|×Ñ 	§¡Ó/Ð/r   c                ób   € V P                   f   R# V  F  pVP                  V8X  g   K  Vu # 	  R# )z8Get one of the possible representations of the response.N)r4   r~   r  s   && r   r€   Ú0ResponseDefinition.get_representation_definition  s2   € à�8‰8ÒÙÛ"ˆNØ×(Ñ(¨JÖ6Ø%Ò%ñ #ñ r   )rY   r  r2   r4   rP   )r"   r#   r$   r%   r&   rZ   r  r”   r¶   rÇ   r€   r'   rQ   rR   s   @r   r   r   É  s-   ø‡ € ÙEôò	NòDòò	0÷ð r   c                   ó†   a a€ ] tR tRt oRtV 3R ltV 3R ltR t]R 4       t	R t
R tRR	 ltR
 tR tR tR tRtVtV ;t# )r   i  z2A definition of the structure of a representation.c                ó>   <€ \         SV `  V4       W n        W0n        R # rP   )ru   rZ   r2   r4   )r8   rY   r2   rœ   r„   s   &&&&€r   rZ   Ú!RepresentationDefinition.__init__  s   ø€ Ü‰Ñ˜Ô%Ø ŒØ%Žr   c                ó(   <€ \         SV `  R R.V4      # )r  r¹   )ru   r<   )r8   r2   r„   s   &&€r   r<   ÚRepresentationDefinition.params  s   ø€ Ü‰w‰~˜w¨Ð0°(Ó;Ð;r   c                ó`   € V P                  V4       Uu. uF  q"P                  NK  	  up# u upi )z#Return the names of all parameters.)r<   rA   )r8   r2   r0   s   && r   r¯   Ú(RepresentationDefinition.parameter_names  s'   € à(,¯©°HÔ(=Ó>Ñ(=˜u—
”
Ñ(=Ñ>Ð>ùÒ>s   ”+c                óX   € V P                  4       P                  P                  R,          # )z4The media type of the representation described here.r˜   )re   r4   r6   ro   s   &r   r~   Ú#RepresentationDefinition.media_type  s$   € ð ×&Ñ&Ó(×,Ñ,×3Ñ3°KÕ@Ð@r   c                óü  € \        \        \        P                  ^,
          4      4      pRV,          p\        P
                  ! \        P                  4      pRW4,          ,           R,           pVf   V# Tp^ p R\        P                  ! V4      ,           R,           P                  R4      p\        P                  ! W�\        P                  R7      '       g    V# VR,           \        V4      ,           pV^,          pK‡  )	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_boundary  s¾   € ä”Tœ#Ÿ+™+¨�/Ó*Ó+ˆØ˜&Õ ˆÜ× Ò ¤§¡Ó-ˆØ ¥Õ.°Õ5ˆØÒØˆOØˆØˆØØœrŸyšy¨›|Õ+¨hÕ6×>Ñ>¸wÓGˆGÜ—9’9˜W´r·|±|×DÓDØð ˆð ˜3•¤ W£Õ-ˆAØ�q�LŠGr   c                ó  € V Fg  w  r4VP                  VP                  R4      4       VP                  R4       VP                  VP                  R4      4       VP                  R4       Ki  	  VP                  R4       R# )z$Write MIME headers to a file object.úUTF-8s   : ó   
N©Úwriter8  )r8   Úbufr  ÚkeyrD   s   &&&  r   Ú_write_headersÚ'RepresentationDefinition._write_headers1  s^   € ã!‰JˆCØ�I‰I�c—j‘j Ó)Ô*Ø�I‰I�eÔØ�I‰I�e—l‘l 7Ó+Ô,Ø�I‰I�gÖñ	 "ð
 	�	‰	�'Ör   c                ó¼   € VP                  R4       VP                  VP                  R4      4       V'       d   VP                  R4       VP                  R4       R# )z,Write a multipart boundary to a file object.s   --rF  rG  NrH  )r8   rJ  r?  Úclosings   &&&&r   Ú_write_boundaryÚ(RepresentationDefinition._write_boundary:  s>   € à�	‰	�%ÔØ�	‰	�(—/‘/ 'Ó*Ô+ßØ�I‰I�eÔØ�	‰	�'Ör   c                óœ  € . pV EF‡  w  r4p\         P                  ! 4       pV'       d!   RpR\        V4      : R\        V4      : R2pMRpR\        V4      ,          pV P                  VRRV3RV3.4       V'       dD   \	        V\
        4      '       g   \        R	\        V4      ,          4      hVP                  V4       M¬\	        V\        4      '       g   \        R
\        V4      ,          4      h\        P                  ! RV4      p	V	RR  F4  p
VP                  V
P                  R4      4       VP                  R4       K6  	  VP                  V	R,          P                  R4      4       VP                  VP                  4       4       EKŠ  	  V P                  RP!                  V4      4      p\         P                  ! 4       pR\        V4      ,          pV P                  VRRV3.4       V F6  pV P#                  Wk4       VP                  V4       VP                  R4       K8  	  V P#                  WkRR7       WvP                  4       3# )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.
zapplication/octet-streamzform-data; name="z"; filename="r@   ztext/plain; charset="utf-8"zform-data; name="%s"zContent-TypezContent-Dispositionzbytes payload expected: %szstring payload expected: %sz
\r\n|\r|\nNrF  rG  z"multipart/form-data; boundary="%s"T)rO  )zMIME-Versionz1.0éÿÿÿÿ)ÚioÚBytesIOr   rL  rw   Úbytesr	  r‰   rI  rx   r6  rË   r8  r  ÚgetvaluerC  rF   rP  )r8   ÚpartsÚencoded_partsÚ	is_binaryrA   rD   rJ  ÚctypeÚcdispÚlinesÚliner?  Úencoded_parts   &&           r   Ú_generate_multipart_formÚ1RepresentationDefinition._generate_multipart_formB  sø  € ð ˆÜ&+Ñ"ˆ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Ð$Ð$r   c                óR  € V P                  4       pVP                  V P                  4      pV P                  ! WA3/ VB pV P                  pVR8X  d&   \        \        VP                  4       4      4      pWg3# VR8X  dz   . p\        4       p	V FQ  p
VP                  V
P                  V	4      pW¹Jg   K&  VP                  V
P                  R8H  V
P                  V34       KS  	  V P                  V4      w  rgWg3# VR8X  d   \        P                  ! V4      pWg3# \!        RV,          4      h)zjBind the definition to parameter values, creating a document.

:return: A 2-tuple (media_type, document).
z!application/x-www-form-urlencodedzmultipart/form-dataÚbinaryrs   zUnsupported media type: '%s')re   r<   r2   rN   r~   r   r  r  Úobjectr7   rA   r  r‰   r`  r|   Údumpsr3   )r8   rI   rK   rd   r<   rL   r~   ÚdocrX  Úmissingr0   rD   s   &&,         r   r”   Ú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ÐIr   c                óL   € V P                   P                  P                  V4      # )z9Turn a representation ID into a RepresentationDefinition.)rY   Úrepresentation_definitionsr7   rj   s   &&r   r`   Ú,RepresentationDefinition._definition_factoryž  s   € à×Ñ×:Ñ:×>Ñ>¸rÓBÐBr   c                óL   € V P                   P                  P                  R4      # )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Ô   ro   s   &r   r^   Ú,RepresentationDefinition._get_definition_url¢  rÖ   r   )r2   r4   )F)r"   r#   r$   r%   r&   rZ   r<   r¯   rÜ   r~   rC  rL  rP  r`  r”   r`   r^   r'   rQ   rÝ   rÞ   s   @@r   r   r     sX   ù‡ € Ù<õ&õ
<ò?ð ñAó ðAòò$ôò@%òDò4C÷+ò +r   c                   ó°   a € ] tR tRt o RtR t]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       tR	 t]R
 4       t]R 4       t]R 4       tRtV tR# )r   i¬  z5One of the parameters of a representation definition.c                ó@   € VP                   V n         Wn        W n        R# )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   )r8   rq  r4   s   &&&r   rZ   ÚParameter.__init__¯  s   € ð +×6Ñ6ˆÔØ.ÔØŽr   c                óL   € V P                   P                  P                  R4      # )zThe name of this parameter.rA   rÔ   ro   s   &r   rA   ÚParameter.name½  ó   € ð �x‰x�‰×"Ñ" 6Ó*Ð*r   c                óL   € V P                   P                  P                  R4      # )zThe style of this parameter.r1   rÔ   ro   s   &r   r1   ÚParameter.styleÂ  s   € ð �x‰x�‰×"Ñ" 7Ó+Ð+r   c                óL   € V P                   P                  P                  R4      # )zThe XSD type of this parameter.r‰   rÔ   ro   s   &r   r‰   ÚParameter.typeÇ  ru  r   c                óL   € V P                   P                  P                  R4      # )a  The 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Ô   ro   s   &r   rB   ÚParameter.fixed_valueÌ  s   € ð �x‰x�‰×"Ñ" 7Ó+Ð+r   c                óp   € V P                   P                  P                  RR4      P                  4       R9   # )z6Whether or not a value for this parameter is required.ÚrequiredÚfalse)Ú1Útruerì   ro   s   &r   rG   ÚParameter.is_required×  s2   € ð —‘—‘×#Ñ# J°Ó8×>Ñ>Ó@Ø ñ!ð 	"r   c                ó8   € V P                   P                  V 4      # )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.
)rq  rÇ   ro   s   &r   Ú	get_valueÚParameter.get_valueÝ  s   € ð ×#Ñ#×7Ñ7¸Ó=Ð=r   c                ó†   € V P                   P                  \        R4      4       Uu. uF  p\        W4      NK  	  up# u upi )z7Return the set of acceptable values for this parameter.rM   )r4   r5   r   ÚOption)r8   Ú
option_tags   & r   rC   ÚParameter.optionsæ  sF   € ð #'§(¡(×"2Ñ"2´:¸hÓ3GÔ"HóJÙ"H�Jô �tÖ(Ù"HñJð 	Jùò Js   §>c                ól   € V P                   P                  \        R4      4      pVf   R# \        W4      # )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)r4   rå   r   r   )r8   Úlink_tags   & r   r‹  ÚParameter.linkì  s/   € ð —8‘8—=‘=¤¨FÓ!3Ó4ˆØÒÙÜ�DÓ#Ð#r   c                óP   € V P                   pVf   \        R4      hVP                  # )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)r8   r‹  s   & r   Úlinked_resourceÚParameter.linked_resourceú  s(   € ð �y‰yˆØŠ<ÜÐGÓHÐHØ�{‰{Ðr   )rY   r4   rq  N)r"   r#   r$   r%   r&   rZ   rÜ   rA   r1   r‰   rB   rG   r„  rC   r‹  r�  r'   rQ   rR   s   @r   r   r   ¬  s´   ø‡ € Ù?òð ñ+ó ð+ð ñ,ó ð,ð ñ+ó ð+ð ñ,ó ð,ð ñ"ó ð"ò
>ð ñJó ðJð
 ñ$ó ð$ð ñó ör   c                   ó:   a € ] tR tRt o RtR t]R 4       tRtV t	R# )r‡  i
  z0One of a set of possible values for a parameter.c                ó   € Wn         W n        R# )zeInitialize the option.

:param parameter: A Parameter.
:param link_tag: An ElementTree <option> tag.
N©rÄ   r4   )r8   rÄ   rˆ  s   &&&r   rZ   ÚOption.__init__  s   € ð #ŒØŽr   c                óL   € V P                   P                  P                  R 4      # )rD   rÔ   ro   s   &r   rD   ÚOption.value  s   € à�x‰x�‰×"Ñ" 7Ó+Ð+r   r”  N)
r"   r#   r$   r%   r&   rZ   rÜ   rD   r'   rQ   rR   s   @r   r‡  r‡  
  s!   ø‡ € Ù:òð ñ,ó ö,r   r‡  c                   ób   a a€ ] tR tRt oRtV 3R lt]R 4       t]R 4       tR t	R t
RtVtV ;t# )	r   i  z©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   <€ \         SV `  VP                  4       Wn        W n        R# )zaInitialize the link.

:param parameter: A Parameter.
:param link_tag: An ElementTree <link> tag.
N)ru   rZ   rY   rÄ   r4   )r8   rÄ   rŒ  r„   s   &&&€r   rZ   ÚLink.__init__"  s"   ø€ ô 	‰Ñ˜×.Ñ.Ô/Ø"ŒØŽr   c                ó\   € V P                   '       g   \        R4      hV P                  4       # )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_followr   re   ro   s   &r   r�  ÚLink.follow,  s0   € ð ��ˆÜð .ó /ð /ð ×&Ñ&Ó(Ð(r   c                óL   €  V P                  4        R#   \         d     R# 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^   r   ro   s   &r   rœ  ÚLink.can_follow5  s,   € ð	Ø×$Ñ$Ô&ñ øô ô 	Úð	ús   ‚ ”#¢#c                óº   € \        V P                  V P                  P                  4       V P                  P                  P                  V4      P                  4      # )z,Turn a resource type ID into a ResourceType.)r	   rY   rÄ   r„  rÑ   r7   r4   rj   s   &&r   r`   ÚLink._definition_factoryB  sG   € äØ×Ñ˜dŸn™n×6Ñ6Ó8Ø×Ñ×+Ñ+×/Ñ/°Ó3×7Ñ7ó9ð 	9r   c                ón   € V P                   P                  P                  R4      pVf   \        R4      hV# )z(Find the URL containing the definition .r‚   zIParameter is a link, but not to a resource with a known WADL description.)r4   r6   r7   r   )r8   r‰   s   & r   r^   ÚLink._get_definition_urlH  s6   € à�x‰x�‰×"Ñ" ?Ó3ˆØŠ<Üð =ó >ð >àˆr   r”  )r"   r#   r$   r%   r&   rZ   rÜ   r�  rœ  r`   r^   r'   rQ   rÝ   rÞ   s   @@r   r   r     sF   ù‡ € ñõð ñ)ó ð)ð ñ
ó ð
ò9÷ò r   c                   ó*   a € ] tR tRt o RtR tRtV tR# )r
   iQ  z,A wrapper around an XML <resource_type> tag.c                ó   € Wn         R# )zfInitialize with a <resource_type> tag.

:param resource_type_tag: An ElementTree <resource_type> tag.
N©r4   )r8   Úresource_type_tags   &&r   rZ   ÚResourceType.__init__T  s	   € ð
 %Žr   r¦  N)r"   r#   r$   r%   r&   rZ   r'   rQ   rR   s   @r   r
   r
   Q  s   ø‡ € Ù6÷%ð %r   c                   óH   a € ] tR tRt o RtR tR tR tR tR t	R t
R	tV tR
# )r   i\  z1A WADL document made programmatically accessible.c                óÌ  € Wn         \        VR4      '       d   V P                  V4      V n        MV P	                  V4      V n        V P                  P                  \        R4      4      V n        V P                  P                  P                  R4      V n
        / V n        / V n        V P                  P                  \        R4      4       F?  pVP                  P                  R4      pVf   K$  \        V RV4      pWPP                  V&   KA  	  V P                  P                  \        R4      4       F.  pVP                  R,          p\        V4      V P                  V&   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Ž   rz   rk   Nr‚   )r‹   r{   Ú_from_streamrf  Ú_from_stringrå   r   r¬  r6   r7   Úresource_baserj  rÑ   r5   r   r
   )r8   r‹   Úmarkuprz   rk   rd   r‚   s   &&&    r   rZ   Ú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×Ñ Ó#ó Kr   c                ó:  € RpRp. p\         P                  ! W4       Ff  w  rVVR8X  d   VP                  V4       K  VR8X  d   VP                  4        K8  VR8X  g   KA  Vf   TpVP	                  \
        \        V4      4       Kh  	  \         P                  ! V4      # )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   &&     r   r­  ÚApplication._from_streamx  s‚   € ð
 /ˆØˆØˆäŸ<š<¨Ö7‰KˆEØ˜
Ô"Ø—‘˜dÖ#Ø˜(Ô"Ø—
‘
–Ø˜'Ö!Ø’<Ø�DØ—‘œ¤ f£Ö.ñ 8ô �~Š~˜dÓ#Ð#r   c                óš   € \        V\        4      '       g   VP                  R4      pV P                  \        P
                  ! V4      4      # )zTurns markup into a document.rF  )rw   rV  r8  r­  rT  rU  )r8   r°  s   &&r   r®  ÚApplication._from_stringŒ  s7   € ä˜&¤%×(Ò(Ø—]‘] 7Ó+ˆFØ× Ñ ¤§¢¨FÓ!3Ó4Ð4r   c                óŠ   € V P                  V4      pV P                  P                  V4      pVf   \        RV,          4      hV# )z7Retrieve a resource type by the URL of its description.r]   )r_   rÑ   r7   ra   )r8   Úresource_type_urlrc   r‚   s   &&  r   ry   ÚApplication.get_resource_type’  sG   € à×#Ñ#Ð$5Ó6ˆØ×+Ñ+×/Ñ/°Ó7ˆØÒ ÜÐ1Ð4EÕEÓFÐFØÐr   c                ó4  € \        V P                  4      P                  4       pRVn        VP	                  R4      '       d   \        V4      P                  4       pMVP                  V4      pVP                  pRVn        W28X  d   V# \        RV,          4      h)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))r   r‹   ÚensureNoSlashÚfragmentÚ
startswithÚresolveri   )r8   r�   Ú
markup_uriÚthis_uriÚpossible_xml_ids   &&   r   r_   ÚApplication.lookup_xml_idš  s“   € ô ˜Ÿ™Ó)×7Ñ7Ó9ˆ
Ø"ˆ
Ôà�>‰>˜&×!Ò!ä˜3“x×-Ñ-Ó/‰Hð "×)Ñ)¨#Ó.ˆHØ"×+Ñ+ˆØ ˆÔàÔ!ð #Ð"ô "ð #-Ø/2õ#3ó 4ð 	4r   c                ó0  € V P                    Uu. uF  pVP                  R,          V8X  g   K  VNK!  	  pp\        V4      ^8  d   R# \        V4      ^8”  d   \        RV,          4      h\	        V \        V P                  VR4      V^ ,          4      # u upi )z`Locate one of the resources described by this document.

:param path: The path to the resource.
r  Nz+More than one resource defined with path %sT)r¬  r6   rE   r   r	   r   r¯  )r8   r  r2   Ú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)rf  r‹   rj  r¯  rÑ   r¬  N)r"   r#   r$   r%   r&   rZ   r­  r®  ry   r_   rÒ  r'   rQ   rR   s   @r   r   r   \  s/   ø‡ € Ù;òBò2$ò(5òò4÷@Fð Fr   )
r   r   r   r   r   r   r   r	   r
   r   ),r&   Ú__all__rÁ   Úemail.utilsr   rT  r|   r4  r6  r2  rÂ   Úurllib.parser   Úxml.etree.ElementTreeÚetreerº  r¶  Úlazr.urir   r   Úwadllib.iso_strptimer   rÌ   rÀ   r   r   r   Ú	Exceptionr   r   r*   r,   r.   rU   r	   r   rä   r   r   r   r‡  r   r
   r   r   r   r   Ú<module>rÜ     s1  ðñ"
ò€ó Ý Û 	Û Û Û 	Û 
Û Ý "ß "Ð "ç å -à	€Ø6Ð ò?ò
%ò
ô	�	ô 	ô
 ô ô 	ô ÷Jñ J÷? ñ ? ôD:$˜xô :$ôzy<Ð'ô y<ôx	gˆXô gôT6˜Ð"4ô 6ôr?Ð+ô ?ôD^+Ð7Ð9Kô ^+ôB[�ô [ô|,ˆXô ,ô"3Ð#ô 3ôl%�8ô %ônF�(ö nFr   