Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/wadllib/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/wadllib/application.pyc


zlOc
@sgdZeZddddddddd	d
g
ZyddlmZWn!ek
rgdd
lmZnXddl	Z	y$ddl
mZddlm
Z
Wn1ek
rddlmZddlm
Z
nXddlZyddlmZWn!ek
rddlmZnXyddlZWnek
r?ddlZnXyddljjZWnDek
ryddlZWn ek
rddljZnXnXddlmZmZddlm Z m!Z!ddl"m#Z#dZ$dZ%dZ&dZ'dZ(d
e)fdYZ*de*fdYZ+de*fdYZ,de-fdYZ.d fd!YZ/d"e.fd#YZ0de0fd$YZ1de.fd%YZ2d&e.e/fd'YZ3de/fd(YZ4de0e/fd)YZ5de.fd*YZ6d+e.fd,YZ7de0fd-YZ8d	e.fd.YZ9de.fd/YZ:dS(0sNavigate 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.
tApplicationtLinktMethodtNoBoundRepresentationErrort	ParametertRepresentationDefinitiontResponseDefinitiontResourcetResourceTypet	WADLErrori(tStringIO(tBytesION(t
MIMEMultipart(tMIMENonMultipart(t	urlencode(tURItmerge(t
_make_unicodet
_string_types(tiso_strptimes	xmlns:maps http://www.w3.org/2001/XMLSchemacCsd|S(s)Scope a tag name with the WADL namespace.s&{http://research.sun.com/wadl/2006/10}((ttag_name((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytwadl_tagWscCsdt|S(s#Turn a tag name into an XPath path.s./(R(R((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt
wadl_xpath\scGs7i}x*|D]"}|dk	r
|j|q
q
W|S(s<Merge any number of dictionaries, some of which may be None.N(tNonetupdate(tdictstfinaltdict((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt_merge_dictsas

cBseZdZRS(sAAn exception having to do with the state of the WADL application.(t__name__t
__module__t__doc__(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR	jscBseZdZRS(sAAn 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.
    (RRR(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRostUnsupportedMediaTypeErrorcBseZdZRS(sA media type was given that's not supported in this context.

    A resource can only be bound to media types it has representations
    of.
    (RRR(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR ystWADLBasecBseZdZRS(s?A base class for objects that contain WADL-derived information.(RRR(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR!stHasParametersMixincBs&eZdZddZedZRS(sAA mixin class for objects that have associated Parameter objects.cCs|dkr|j}n|dkr3tdn|jdkrFgS|jjtd}|dkrngSg|D]-}|jjd|krut||^quS(s6Find subsidiary parameters that have the given styles.s&Could not find any particular resourcetparamtstyleN(	Rtresourcet
ValueErrorttagtfindallRtattribtgetR(tselftstylesR%t
param_tagst	param_tag((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytparamss
c

Kst||}i}x@|D]8}|j}|jdk	r||kr||||jkr|td||||jfn|j||<ng|jD]}|j^q}	t|	dkr||kr|||	krtd|||dj|	fn|r0|j	r0||kr0td|n||kr||||<||=qqWt|dkrtddj|j
n|S(	sMake 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.
        s=Value '%s' for parameter '%s' conflicts with fixed value '%s'is=Invalid value '%s' for parameter '%s': valid values are: "%s"s", "s$No value for required parameter '%s'sUnrecognized parameter(s): '%s's', 'N(Rtnametfixed_valueRR&toptionstvaluetlentjointis_requiredtkeys(
R+R/tparam_valuestenforce_completenesstkw_param_valuestvalidated_valuesR#R0toptionR2((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytvalidate_param_valuess6
	
#
N(RRRRR/tTrueR=(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR"stWADLResolvableDefinitioncBs2eZdZdZdZdZdZRS(s=A base class for objects whose definitions may be references.cCsd|_||_dS(sInitialize with a WADL application.

        :param application: A WADLDefinition. Relative links are
            assumed to be relative to this object's URL.
        N(Rt_definitiontapplication(R+RA((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt__init__s	cCs|jdk	r|jS|j}|dkr;||_|S|jj|}|j|}|dkr{td|n||_|S(sReturn 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.
        sNo such XML ID: "%s"N(R@Rt_get_definition_urlRAt
lookup_xml_idt_definition_factorytKeyError(R+t
object_urltxml_idt
definition((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytresolve_definitions		cCs
tdS(sxTransform an XML ID into a wadllib wrapper object.

        Which kind of object it is depends on the subclass.
        N(tNotImplementedError(R+tid((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyREscCs
tdS(smFind the URL that identifies an external reference.

        How to do this depends on the subclass.
        N(RK(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRCs(RRRRBRJRERC(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR?s
			"	cBseZdZddeddZedZedZedZ	deddZ
dZdddddZdd	Z
dd
ZedZddZd
ZdZdZdZddZdZRS(s/A resource, possibly bound to a representation.cCstt|j|||_t|trI|jj|j|_n	||_d|_
|dk	r|dkr|rtjt
||_
q||_
qtd|n||_|dk	r|dk	r||_q|j|j|_ndS(s[
        :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.
        sapplication/jsons?This resource doesn't define a representation for media type %sN(tsuperRRBt_urlt
isinstanceRRAtget_resource_typeR'RtrepresentationtjsontloadsRR t
media_typetrepresentation_definitiontget_representation_definition(R+RAturlt
resource_typeRQRTtrepresentation_needs_processingRU((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBs(			
	cCs|jS(s Return the URL to this resource.(RN(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRW;scCs|jdkrdS|jjjd}|dk	r8|S|jjjd}|dk	rt|jjj}t|d|SdS(s@Return the URL to the type definition for this resource, if any.ttypeRLt#N(	R'RR)R*RRAt
markup_urltensureSlashtstr(R+RWttype_idtbase((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyttype_url@scCs|jjdS(sReturn the ID of this resource.RL(R'R)(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRLRssapplication/jsoncCs%t|j|j|j||||S(sBind 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.
        (RRARWR'(R+RQRTRYRU((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytbindWscCsb|jdj}x9|D]1}|jj}|jjd|kr|SqWtd|dS(s<Get a description of one of this resource's representations.tGETt	mediaTypes4No definition for representation with media type %s.N(t
get_methodtresponseRJR'R)R*R (R+RTtdefault_get_responseRQtrepresentation_tag((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRVms
cCsxx|jD]j}|jjddj}|dksL||jkr
t||}|j|||rw|Sq
q
WdS(sLook 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.
        R0tN(t_method_tag_iterR)R*tlowerRRtis_described_by(R+thttp_methodRTtquery_paramstrepresentation_paramst
method_tagR0tmethod((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRews	cCs|j|j|S(s~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.
        (t_find_representation_definitionR/(R+RT((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt
parameterss
cCs|j|j|S(sA 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.
        (Rrtparameter_names(R+RT((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRts
ccs)x"|jD]}t||Vq
WdS(s6An iterator over the methods defined on this resource.N(RjR(R+Rp((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytmethod_iterscCsa|j|}|j}xB|jtdD]+}|jjd|kr.t||Sq.WdS(sFind 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.
        R#R0N(RrR'R(RR)R*RR(R+t
param_nameRTRIRhR.((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt
get_parameters	cCs/|jdkrtdn|jdkr|jdkrRtd|jn|j|j}|dk	r|j|j|j	\}}|t
kr|dkryt|}Wqtk
r
y&t
j
tj|ddd	!}Wqtk
r	t|qXqXqn|Std
|jdS(
sFind the value of a parameter, given the Parameter object.

        :raise ValueError: If the parameter value can't be converted into
        its defined type.
        s,Resource is not bound to any representation.sapplication/jsontplains8Don't know how to find value for a parameter of type %s.tdateTimetdates%Y-%m-%diisEPath traversal not implemented for a representation of media type %s.N(RyRz(RQRRRTR$RKR0t_dereference_namespaceR'RZtXML_SCHEMA_NS_URIRR&tdatetimettimetstrptime(R+t	parameterR3t
namespace_urlt	data_type((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytget_parameter_values2
 
cCsd|dk	r3d|kr3|jdd\}}nd}|jt}|j|d}||fS(sSplits a value into namespace URI and value.

        :param tag: A tag to use as context when mapping namespace
        names to URIs.
        t:iRiN(RtsplitR*tNS_MAP(R+R'R3t	namespacetns_mapR((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR{scCs|jjj|S(s-Given an ID, find a ResourceType for that ID.(RAtresource_typesR*(R+RL((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRE	scCs|jjjdS(sReturn 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.
        RZ(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRC
scCsU|jdk	r!|jj}n*|dk	r?|j|}ntd|jS(s3Get 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
        sSResource is not bound to any representation, and no media media type was specified.N(RQRRURJRVR(R+RTRI((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRrs	ccs8|jj}x"|jtdD]}|Vq%WdS(s+Iterate over this resource's <method> tags.RqN(RJR'R(R(R+RIRp((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRj9sN(RRRRR>RBtpropertyRWRaRLRbRVReRsRtRuRwRR{RERCRrRj(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs.1	
	 

	0				#cBseZdZdZedZedZedZedZd	dZ
d	d	dZd	d	d	dZRS(
s*A wrapper around an XML <method> tag.
    cCs%||_|jj|_||_dS(saInitialize with a <method> tag.

        :param method_tag: An ElementTree <method> tag.
        N(R%RAR'(R+R%Rp((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBCs	cCst||jjtdS(s@Return the definition of a request that invokes the WADL method.trequest(tRequestDefinitionR'tfindR(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRLscCs"t|j|jjtdS(s9Return the definition of the response to the WADL method.Rf(RR%R'RR(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRfQs	cCs|jjjdS(s)The XML ID of the WADL method definition.RL(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRLWscCs|jjjdjS(sThe 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.
        R0(R'R)R*Rk(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR0\scKs|jj||S(s4Return the request URL to use to invoke this method.(Rt	build_url(R+R8R:((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytbuild_request_urlescKs|jj|||S(sBuild a representation to be sent when invoking this method.

        :return: A 2-tuple of (media_type, representation).
        (RRQ(R+RTR8R:((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytbuild_representationis	cCs1d}|dk	r7|jj|}|dkr7tSn|dk	rt|dkr|j}|dkrntSy|j|j|tWqtk
rtSXn|dkst|dkrtS|dk	r|j	|SxO|jj
D]A}y'|j|j|j|ttSWqtk
r(qXqWtS(sReturns 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.
        iN(
RRRVtFalseR4R=RnR&R>RltrepresentationsR/R%(R+RTtquery_valuestrepresentation_valuesRQR((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRlrs<			


N(
RRRRBRRRfRLR0RRRRl(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR@s			RcBs\eZdZdZedZedZddZdddZ	ddZ
RS(sBA wrapper around the description of the request invoking a method.cCs4||_|jj|_|jj|_||_dS(sInitialize with a <request> tag.

        :param resource: The resource to which this request can be sent.
        :param request_tag: An ElementTree <request> tag.
        N(RqR%RAR'(R+Rqtrequest_tag((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBs	cCs|jdgS(s,Return the query parameters for this method.tquery(R/(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRnsccs>x7|jjtdD]}t|j|j|VqWdS(NRQ(R'R(RRRAR%(R+RI((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRscCs7x0|jD]%}|dks+|j|kr
|Sq
WdS(s1Return the appropriate representation definition.N(RRRT(R+RTRQ((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRVscKs>|j|}|dkr.td|n|j||S(sBuild a representation to be sent along with this request.

        :return: A 2-tuple of (media_type, representation).
        s,Cannot build representation of media type %sN(RVRt	TypeErrorRb(R+RTR8R:RI((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRQs

cKsl|j|j||}|jj}t|dkrhd|krKd}nd}||t|7}n|S(s4Return the request URL to use to invoke this method.it?t&(R=RnR%RWR4R(R+R8R:R;RWtappend((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs	N(RRRRBRRnRRRVRQR(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs	cBsGeZdZddZdZdZdZdZdZ	RS(s;A wrapper around the description of a response to a method.cCs+|j|_||_||_||_dS(sgInitialize with a <response> tag.

        :param response_tag: An ElementTree <response> tag.
        N(RAR%R'theaders(R+R%tresponse_tagR((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBs		ccsGtd}x4|jj|D] }t|jj|j|VqWdS(sGet an iterator over the representation definitions.

        These are the representations returned in response to an
        invocation of this method.
        RQN(RR'R(RR%RA(R+tpathRh((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt__iter__scCst|j|j|S(sBind the response to a set of HTTP headers.

        A WADL response can have associated header parameters, but no
        other kind.
        (RR%R'(R+R((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRbscCsdx]|jjtdD]C}|jjd|kr|jjddkrt||SqWdS(s,Find a header parameter within the response.R#R0R$theaderN(R'R(RR)R*RR(R+RvR.((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRws
cCsV|jdkrtdn|jdkrCtd|jn|jj|jS(s:Find the value of a parameter, given the Parameter object.s,Response object is not bound to any headers.Rs8Don't know how to find value for a parameter of type %s.N(RRRR$RKR*R0(R+R((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRscCs;|jdkrdSx!|D]}|j|kr|SqWdS(s8Get one of the possible representations of the response.N(R'RRT(R+RTRQ((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRVs
N(
RRRRRBRRbRwRRV(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs
				cBsSeZdZdZdZdZedZdZdZ	dZ
RS(s2A definition of the structure of a representation.cCs,tt|j|||_||_dS(N(RMRRBR%R'(R+RAR%Rh((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRB(s	cCstt|jddg|S(NRRx(RMRR/(R+R%((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR/-scCs#g|j|D]}|j^qS(s#Return the names of all parameters.(R/R0(R+R%R#((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRt1scCs|jjjdS(s4The media type of the representation described here.Rd(RJR'R)(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRT5scKs|j}|j|j}|j|||}|j}|dkrWt|}nZ|dkrt}|jdt}	x|D]}
|j	|
j
|	}||	k	r|
jdkrd\}}
i}nd\}}
idd	6}t||
|}|j
|d
|
j
|d<|j|qqWt|}|jdrf||jd
d}n|jd|j}n.|dkrtj|}ntd|||fS(szBind the definition to parameter values, creating a document.

        :return: A 2-tuple (media_type, document).
        s!application/x-www-form-urlencodedsmultipart/form-datatbinaryRAsoctet-streamttextRxsutf-8tcharsetsform-data; name="%s"sContent-DispositionsFrom s
is; boundary="%s"sapplication/jsonsUnsupported media type: '%s'(sapplicationsoctet-stream(stextsplain(RJR/R%R=RTRRtset_typetobjectR*R0RZR
tset_payloadtattachR^t
startswithRtget_content_typetget_boundaryRRtdumpsR&(R+R8R:RIR/R;RTtdoctoutertmissingR#R3tmaintypetsubtypetinner((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRb:s@		
	
	

	cCs|jjj|S(s9Turn a representation ID into a RepresentationDefinition.(RAtrepresentation_definitionsR*(R+RL((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyREescCs|jjjdS(sFind 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.
        thref(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRCis(RRRRBR/RtRRTRbRERC(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR%s				+	cBseZdZdZedZedZedZedZedZ	dZ
edZed	Zed
Z
RS(s5One of the parameters of a representation definition.cCs"|j|_||_||_dS(sInitialize 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(RAtvalue_containerR'(R+RR'((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBvs
	cCs|jjjdS(sThe name of this parameter.R0(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR0scCs|jjjdS(sThe style of this parameter.R$(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR$scCs|jjjdS(sThe XSD type of this parameter.RZ(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRZscCs|jjjdS(s9The 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.
        tfixed(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR1s	cCs"|jjjddjdkS(s6Whether or not a value for this parameter is required.trequiredtfalset1ttrue(RR(R'R)R*Rk(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR6scCs|jj|S(sThe 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.
        (RR(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt	get_valuescCs2g|jjtdD]}t||^qS(s7Return the set of acceptable values for this parameter.R<(R'R(RtOption(R+t
option_tag((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR2scCs5|jjtd}|dkr(dSt||S(sGet 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.
        tlinkN(R'RRRR(R+tlink_tag((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs	cCs+|j}|dkr$tdn|jS(sFollow 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.
        s(This parameter isn't a link to anything.N(RRR&tfollow(R+R((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytlinked_resources
	(RRRRBRR0R$RZR1R6RR2RR(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRss			RcBs&eZdZdZedZRS(s0One of a set of possible values for a parameter.cCs||_||_dS(s}Initialize the option.

        :param parameter: A Parameter.
        :param link_tag: An ElementTree <option> tag.
        N(RR'(R+RR((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBs	cCs|jjjdS(NR3(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR3s(RRRRBRR3(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs		cBsGeZdZdZedZedZdZdZRS(sA 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'.
    cCs/tt|j|j||_||_dS(syInitialize the link.

        :param parameter: A Parameter.
        :param link_tag: An ElementTree <link> tag.
        N(RMRRBRARR'(R+RR((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBs	cCs"|jstdn|jS(s$Follow the link to another Resource.sfCannot follow a link when the target has no WADL description. Try using a general HTTP client instead.(t
can_followR	RJ(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs	cCs)y|j}Wntk
r$tSXtS(sCan this link be followed within wadllib?

        wadllib can follow a link if it points to a resource that has
        a WADL definition.
        (RCR	RR>(R+tdefinition_url((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs

cCs.t|j|jj|jjj|jS(s,Turn a resource type ID into a ResourceType.(RRARRRR*R'(R+RL((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyREscCs4|jjjd}|dkr0tdn|S(s(Find the URL containing the definition .RXsIParameter is a link, but not to a resource with a known WADL description.N(R'R)R*RR	(R+RZ((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRCs(	RRRRBRRRRERC(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs	
	
	cBseZdZdZRS(s,A wrapper around an XML <resource_type> tag.cCs
||_dS(svInitialize with a <resource_type> tag.

        :param resource_type_tag: An ElementTree <resource_type> tag.
        N(R'(R+tresource_type_tag((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBs(RRRRB(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRscBsDeZdZdZdZdZdZdZdZRS(s1A WADL document made programmatically accessible.cCs.||_t|dr-|j||_n|j||_|jjtd|_|jjj	d|_
i|_i|_x`|jj
tdD]F}|jj	d}|dk	rt|d|}||j|<qqWx@|jj
tdD]&}|jd}t||j|<qWdS(sParse 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.
        treadt	resourcesR`RQRLRXN(R\thasattrt_from_streamRt_from_stringRRRR)R*t
resource_baseRRR(RRR(R+R\tmarkupRQRLRIRX((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRB%s"			
cCsd}d}g}xtj||D]{\}}|dkrM|j|q%|dkrf|jq%|dkr%|dkr|}n|jtt|q%q%Wtj|S(srTurns markup into a document.

        Just a wrapper around ElementTree which keeps track of namespaces.
        tstartsstart-nssend-ns(sstartsstart-nssend-nsN(	RtETt	iterparseRtpoptsetRRtElementTree(R+tstreamteventstrootRteventtelem((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR>s
	cCs|jt|S(sTurns markup into a document.(RR(R+R((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRRscCsD|j|}|jj|}|dkr@td|n|S(s7Retrieve a resource type by the URL of its description.sNo such XML ID: "%s"N(RDRR*RRF(R+tresource_type_urlRHRX((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRPVs
cCst|jj}d|_|jdrBt|j}n|j|}|j}d|_||krs|Std|dS(sA 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.
        thttps,Can't look up definition in another url (%s)N(RR\t
ensureNoSlashRtfragmentRtresolveRK(R+RWt
markup_uritthis_uritpossible_xml_id((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRD^s			cCsg|jD]}|jd|kr
|^q
}t|dkrEdSt|dkrjtd|nt|t|j|t|dS(spLocate one of the resources described by this document.

        :param path: The path to the resource.
        Ris+More than one resource defined with path %siN(	RR)R4RR	RRRR>(R+RR%tmatching((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytget_resource_by_path~s
(	RRRRBRRRPRDR(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR"s					 (;RRZt
__metaclass__t__all__t	cStringIOR
RtImportErrortioR}temail.mime.multipartRtemail.mime.nonmultipartR
temail.MIMEMultiparttemail.MIMENonMultipartR~turllib.parseRturllibt
simplejsonRRtxml.etree.cElementTreetetreetcElementTreeRtelementtree.ElementTreeRtlazr.uriRRtwadllibRRtwadllib.iso_strptimeRRR|RRRt	ExceptionR	RR RR!R"R?RRRRRRRRRR(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt<module>s~	





				
B==j9BN]6