403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/wadllib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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
rËddlmZddlm
Z
nXddlZyddlmZWn!ek
rddlmZnXyddlZWnek
r?ddlZnXyddljjZWnDek
rœyddlZWn ek
r˜ddljZnXnXddlmZmZddlm Z m!Z!ddl"m#Z#dZ$dZ%d„Z&d„Z'd„Z(d
e)fd„ƒYZ*de*fd„ƒYZ+de*fd„ƒYZ,de-fd„ƒYZ.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(0sû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.
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(s‘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.
    (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&eZdZdd„Zed„ZRS(sAA mixin class for objects that have associated Parameter objects.cCs¦|dkr|j}n|dkr3tdƒ‚n|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.pytparamsˆs
c

Kst||ƒ}i}x@|D]8}|j}|jdk	rŒ||kr||||jkr|td||||jfƒ‚n|j||<ng|jD]}|j^q–}	t|	ƒdkr||kr|||	krtd|||dj|	ƒfƒ‚n|r0|j	r0||kr0td|ƒ‚n||kr||||<||=qqWt|ƒdkrŒtddj|j
ƒƒƒ‚n|S(	s¼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.
        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_values—s6
	
#
N(RRRRR/tTrueR=(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR"…stWADLResolvableDefinitioncBs2eZdZd„Zd„Zd„Zd„ZRS(s=A base class for objects whose definitions may be references.cCsd|_||_dS(s§Initialize 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(sÞ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.
        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_definitionÓs		cCs
tƒ‚dS(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.pyREõscCs
tƒ‚dS(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.pyRCüs(RRRRBRJRERC(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR?Çs
			"	cBsìeZdZddedd„Zed„ƒZed„ƒZed„ƒZ	dedd„Z
d„Zddddd„Zdd	„Z
dd
„Zed„ƒZdd„Zd
„Zd„Zd„Zd„Zdd„Zd„ZRS(s/A resource, possibly bound to a representation.cCsütt|ƒj|ƒ||_t|tƒrI|jj|ƒj|_n	||_d|_
|dk	r³|dkr |r”tjt
|ƒƒ|_
q°||_
q³td|ƒ‚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	rƒt|jjƒjƒ}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(s—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.
        (RRARWR'(R+RQRTRYRU((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytbindWscCsb|jdƒj}x9|D]1}|jƒj}|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|jƒD]j}|jjddƒjƒ}|dksL||jƒkr
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
parameters˜s
cCs|j|ƒj|ƒS(s‚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.
        (Rrtparameter_names(R+RT((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRt¥s
ccs)x"|jƒD]}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_iter²scCsa|j|ƒ}|j}xB|jtdƒƒD]+}|jjdƒ|kr.t||ƒSq.WdS(sÈ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.
        R#R0N(RrR'R(RR)R*RR(R+t
param_nameRTRIRhR.((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt
get_parameter¸s	cCs/|jdkrtdƒ‚n|jdkr|jdkrRtd|jƒ‚n|j|j}|dk	r|j|j|j	ƒ\}}|t
kr|dkryt|ƒ}Wqtk
r
y&t
j
tj|dƒdd	!Œ}Wqtk
r	t|ƒ‚qXqXqn|Std
|jƒ‚dS(
s¨Find 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_valueËs2
 
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|jjjdƒS(sý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.
        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ƒ‚|jƒS(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|jƒj}x"|jtdƒƒD]}|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>RBtpropertyRWRaRLRbRVReRsRtRuRwRƒR{RERCRrRj(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRs.1	
	 

	0				#cBs€eZdZd„Zed„ƒZed„ƒZed„ƒZed„ƒZd	d„Z
d	d	d„Zd	d	d	d„Z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||jjtdƒƒƒS(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.pyR‹LscCs"t|j|jjtdƒƒƒS(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|jjjdƒS(s)The XML ID of the WADL method definition.RL(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRLWscCs|jjjdƒjƒS(s«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.
        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.(R‹t	build_url(R+R8R:((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytbuild_request_urlescKs|jj|||S(s‚Build a representation to be sent when invoking this method.

        :return: A 2-tuple of (media_type, representation).
        (R‹RQ(R+RTR8R:((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytbuild_representationis	cCs1d}|dk	r7|jj|ƒ}|dkr7tSn|dk	r t|ƒdkr |j}|dkrntSy|j|j|tƒWq tk
rœtSXn|dks¾t|ƒdkrÂtS|dk	rÛ|j	|ƒSxO|jj
D]A}y'|j|j|jƒ|tƒtSWqètk
r(qèXqèWtS(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(
RR‹RVtFalseR4R=RnR&R>RltrepresentationsR/R%(R+RTtquery_valuestrepresentation_valuesRQR‹((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRlrs<			


N(
RRRRBRŠR‹RfRLR0RRRRl(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR@s			RŒcBs\eZdZd„Zed„ƒZed„ƒZdd„Zddd„Z	dd„Z
RS(sBA wrapper around the description of the request invoking a method.cCs4||_|jj|_|jj|_||_dS(s­Initialize 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.pyRB¬s	cCs|jdgƒS(s,Return the query parameters for this method.tquery(R/(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRn·sccs>x7|jjtdƒƒD]}t|j|j|ƒVqWdS(NRQ(R'R(RRRAR%(R+RI((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR’¼scCs7x0|jD]%}|dks+|j|kr
|Sq
WdS(s1Return the appropriate representation definition.N(R’RRT(R+RTRQ((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRVÂscKs>|j|ƒ}|dkr.td|ƒ‚n|j||S(s€Build 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.pyRQÉs

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.pyRŽÕs	N(RRRRBRŠRnR’RRVRQRŽ(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRŒªs	cBsGeZdZdd„Zd„Zd„Zd„Zd„Zd„Z	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.pyRBës		ccsGtdƒ}x4|jj|ƒD] }t|jj|j|ƒVqWdS(s¢Get 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]|jjtdƒƒD]C}|jjdƒ|kr|jjdƒdkrt||ƒ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|jdkrtdƒ‚n|jdkrCtd|jƒ‚n|jj|jƒS(s:Find the value of a parameter, given the Parameter object.s,Response object is not bound to any headers.RŸs8Don't know how to find value for a parameter of type %s.N(R›RRR$RKR*R0(R+R€((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRƒs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(
RRRRRBRžRbRwRƒRV(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRãs
				cBsSeZdZd„Zd„Zd„Zed„ƒZd„Zd„Z	d„Z
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(NR–Rx(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|jƒjjdS(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|dkrƒtƒ}|jdƒtƒ}	x¬|D]¤}
|j	|
j
|	ƒ}||	k	r‰|
jdkrÔd\}}
i}nd\}}
idd	6}t||
|}|j
|ƒd
|
j
|d<|j|ƒq‰q‰Wt|ƒ}|jdƒrf||jd
ƒd}n|jƒd|jƒ}n.|dkr¡tj|ƒ}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|jjjdƒS(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/RtRŠRTRbRERC(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR%s				+	cBs˜eZdZd„Zed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZ	d„Z
ed„ƒZed	„ƒZed
„ƒZ
RS(s5One of the parameters of a representation definition.cCs"|j|_||_||_dS(sÏ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(RAtvalue_containerR'(R+R³R'((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBvs
	cCs|jjjdƒS(sThe name of this parameter.R0(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR0„scCs|jjjdƒS(sThe style of this parameter.R$(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR$‰scCs|jjjdƒS(sThe XSD type of this parameter.RZ(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRZŽscCs|jjjdƒS(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.pyR1“s	cCs"|jjjddƒjƒdkS(s6Whether or not a value for this parameter is required.trequiredtfalset1ttrue(R·R¸(R'R)R*Rk(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR6žscCs|jj|ƒS(síThe value of this parameter in the bound representation/headers.

        :raise NoBoundRepresentationError: If this parameter's value
               container is not bound to a representation or a set of
               headers.
        (R³Rƒ(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt	get_value¤scCs2g|jjtdƒƒD]}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.pyR2­scCs5|jjtdƒƒ}|dkr(dSt||ƒS(sÃ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.
        tlinkN(R'RRRR(R+tlink_tag((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR¼³s	cCs+|j}|dkr$tdƒ‚n|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(R¼RR&tfollow(R+R¼((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytlinked_resourceÁs
	(RRRRBRŠR0R$RZR1R6R¹R2R¼R¿(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRss			RºcBs&eZdZd„Zed„ƒZRS(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(R€R'(R+R€R»((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBÓs	cCs|jjjdƒS(NR3(R'R)R*(R+((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyR3Üs(RRRRBRŠR3(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRºÐs		cBsGeZdZd„Zed„ƒZed„ƒZd„Zd„ZRS(sµ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'.
    cCs/tt|ƒj|jƒ||_||_dS(syInitialize the link.

        :param parameter: A Parameter.
        :param link_tag: An ElementTree <link> tag.
        N(RMRRBRAR€R'(R+R€R½((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRBès	cCs"|jstdƒ‚n|jƒS(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.pyR¾òs	cCs)y|jƒ}Wntk
r$tSXtS(s”Can this link be followed within wadllib?

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

cCs.t|j|jjƒ|jjj|ƒjƒS(s,Turn a resource type ID into a ResourceType.(RRAR€R¹R‰R*R'(R+RL((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyREscCs4|jjjdƒ}|dkr0tdƒ‚n|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(	RRRRBRŠR¾RÀRERC(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRás	
	
	cBseZdZd„ZRS(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.pyRscBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s1A WADL document made programmatically accessible.cCs.||_t|dƒr-|j|ƒ|_n|j|ƒ|_|jjtdƒƒ|_|jjj	dƒ|_
i|_i|_x`|jj
tdƒƒD]F}|jj	dƒ}|dk	rt|d|ƒ}||j|<qqWx@|jj
tdƒƒD]&}|jd}t|ƒ|j|<qWdS(sÝ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.
        treadt	resourcesR`RQRLRXN(R\thasattrt_from_streamR«t_from_stringRRRÄR)R*t
resource_baseR±R‰R(RRR(R+R\tmarkupRQRLRIRX((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRB%s"			
cCs±d}d}g}xtj||ƒD]{\}}|dkrM|j|ƒq%|dkrf|jƒq%|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	iterparseRštpoptsetR†RtElementTree(R+tstreamteventstrootRˆteventtelem((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRÆ>s
	cCs|jt|ƒƒS(sTurns markup into a document.(RÆR(R+RÉ((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRÇRscCsD|j|ƒ}|jj|ƒ}|dkr@td|ƒ‚n|S(s7Retrieve a resource type by the URL of its description.sNo such XML ID: "%s"N(RDR‰R*RRF(R+tresource_type_urlRHRX((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyRPVs
cCs‡t|jƒjƒ}d|_|jdƒrBt|ƒjƒ}n|j|ƒ}|j}d|_||krs|Std|ƒ‚dS(sÖ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.
        thttps,Can't look up definition in another url (%s)N(RR\t
ensureNoSlashRtfragmentR§tresolveRK(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ƒ|dƒS(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(	RÄR)R4RR	RRRÈR>(R+RR%tmatching((s7/usr/lib/python2.7/dist-packages/wadllib/application.pytget_resource_by_path~s
(	RRRRBRÆRÇRPRDRÞ(((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cElementTreeRËtelementtree.ElementTreeRÏtlazr.uriRRtwadllibRRtwadllib.iso_strptimeRR†R|RRRt	ExceptionR	RR R¤R!R"R?RRRŒRRRRºRRR(((s7/usr/lib/python2.7/dist-packages/wadllib/application.pyt<module>s~	





				
B=ÿ=j9BN]6

Youez - 2016 - github.com/yon3zu
LinuXploit