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/landscape/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/schema.pyc
ó
}9Rc@s>dZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd	efd
„ƒYZdefd„ƒYZd
efd„ƒYZ	defd„ƒYZ
defd„ƒYZdefd„ƒYZdefd„ƒYZ
defd„ƒYZdefd„ƒYZdefd„ƒYZdS(s"A schema system. Yes. Another one!tInvalidErrorcBseZdZRS(s&Raised when invalid input is received.(t__name__t
__module__t__doc__(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRstConstantcBs eZdZd„Zd„ZRS(s1Something that must be equal to a constant value.cCs
||_dS(N(tvalue(tselfR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyt__init__scCs/||jkr+td||jfƒ‚n|S(Ns%r != %r(RR(RR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pytcoerces(RRRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR	s	tAnycBs eZdZd„Zd„ZRS(ssSomething which must apply to any of a number of different schemas.

    @param schemas: Other schema objects.
    cGs
||_dS(N(tschemas(RR
((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRscCsVx6|jD]+}y|j|ƒSWq
tk
r4q
Xq
Wtd||jfƒ‚dS(sˆ
        The result of the first schema which doesn't raise
        L{InvalidError} from its C{coerce} method will be returned.
        s!%r did not match any schema in %sN(R
RR(RRtschema((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRs
(RRRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR	s	tBoolcBseZdZd„ZRS(s!Something that must be a C{bool}.cCs)t|tƒs%td|fƒ‚n|S(Ns%r is not a bool(t
isinstancetboolR(RR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR,s(RRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR*stIntcBseZdZd„ZRS(s,Something that must be an C{int} or C{long}.cCs/t|ttfƒs+td|fƒ‚n|S(Ns%r isn't an int or long(R
tinttlongR(RR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR4s(RRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR2stFloatcBseZdZd„ZRS(s7Something that must be an C{int}, C{long}, or C{float}.cCs2t|tttfƒs.td|fƒ‚n|S(Ns%r isn't a float(R
RRtfloatR(RR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR<s(RRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR:stStringcBseZdZd„ZRS(s Something that must be a C{str}.cCs)t|tƒs%td|fƒ‚n|S(Ns%r isn't a str(R
tstrR(RR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRDs(RRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRBstUnicodecBseZdZd„ZRS(s$Something that must be a C{unicode}.cCs)t|tƒs%td|fƒ‚n|S(Ns%r isn't a unicode(R
tunicodeR(RR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRLs(RRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRJstUnicodeOrStringcBs eZdZd„Zd„ZRS(s¼Something that must be a C{unicode} or {str}.

    If the value is a C{str}, it will automatically be decoded.

    @param encoding: The encoding to automatically decode C{str}s with.
    cCs
||_dS(N(tencoding(RR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRZscCsƒt|tƒrZy|j|jƒ}WqZtk
rV}td|t|ƒfƒ‚qZXnt|tƒstd|fƒ‚n|S(Ns%r can't be decoded: %ss%r isn't a unicode(R
RtdecodeRtUnicodeDecodeErrorRR(RRte((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR]s#(RRRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRRs	tListcBs eZdZd„Zd„ZRS(snSomething which must be a C{list}.

    @param schema: The schema that all values of the list must match.
    cCs
||_dS(N(R(RR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRmscCsžt|tƒs%td|fƒ‚nt|ƒ}xft|ƒD]X\}}y|jj|ƒ||<Wq>tk
r•}td||j|fƒ‚q>Xq>W|S(Ns%r is not a lists%r could not coerce with %s: %s(R
tlistRt	enumerateRR(RRtnew_listtitsubvalueR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRps(RRRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRhs	tTuplecBs eZdZd„Zd„ZRS(s¤Something which must be a fixed-length tuple.

    @param schema: A sequence of schemas, which will be applied to
        each value in the tuple respectively.
    cGs
||_dS(N(R(RR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR…scCs´t|tƒs%td|fƒ‚nt|ƒt|jƒkrktdt|jƒt|ƒ|fƒ‚ng}x6t|j|ƒD]"\}}|j|j|ƒƒq„Wt|ƒS(Ns%r is not a tuplesNeed %s items, got %s in %r(R
ttupleRtlenRtziptappendR(RRt	new_valueR((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRˆs%(RRRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR#~s	tKeyDictcBs#eZdZdd„Zd„ZRS(séSomething which must be a C{dict} with defined keys.

    The keys must be constant and the values must match a per-key schema.

    @param schema: A dict mapping keys to schemas that the values of those
        keys must match.
    cCs1|dkrg}nt|ƒ|_||_dS(N(tNonetsettoptionalR(RRR,((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRœs	c	Cs"i}t|tƒs+td|fƒ‚nxœ|jƒD]Ž\}}||jkrotd||jfƒ‚ny|j|j|ƒ||<Wq8tk
rÅ}td|||j||fƒ‚q8Xq8Wt|jƒƒ}t|jjƒƒ|j}||}|rtd|fƒ‚n|S(Ns%r is not a dict.s%r is not a valid key as per %rs7Value of %r key of dict %r could not coerce with %s: %ssMissing keys %s(	R
tdictRt	iteritemsRRR+tkeysR,(	RRtnew_dicttktvRtnew_keyst
required_keystmissing((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR¢s&%
N(RRRR*RR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR)”stDictcBs eZdZd„Zd„ZRS(s°Something which must be a C{dict} with arbitrary keys.

    @param key_schema: The schema that keys must match.
    @param value_schema: The schema that values must match.
    cCs||_||_dS(N(t
key_schematvalue_schema(RR7R8((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR¿s	cCsnt|tƒs%td|fƒ‚ni}x<|jƒD].\}}|jj|ƒ||jj|ƒ<q8W|S(Ns%r is not a dict.(R
R-RtitemsR8RR7(RRR0R1R2((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRÃs&(RRRRR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR6¸s	tMessagecBs#eZdZdd„Zd„ZRS(sŸ
    Like L{KeyDict}, but with three predefined keys: C{type}, C{api},
    and C{timestamp}. Of these, C{api} and C{timestamp} are optional.


    @param type: The type of the message. The C{type} key will need to
        match this as a constant.

    @param schema: A dict of additional schema in a format L{KeyDict}
        will accept.
    @param optional: An optional list of keys that should be optional.
    cCs||_tƒ|d<ttƒtdƒƒ|d<t|ƒ|d<|dk	rd|jddgƒnddg}tt|ƒj	|d|ƒdS(Nt	timestamptapittypeR,(
R=RR	RRR*textendtsuperR:R(RR=RR,((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRÙs	
cCsLx3|jƒD]%}||jkr
|j|ƒq
q
Wtt|ƒj|ƒS(N(R/RtpopR?R:R(RRR1((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyRäsN(RRRR*RR(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyR:ÌsN(Rt	ExceptionRtobjectRR	RRRRRRRR#R)R6R:(((s4/usr/lib/python2.7/dist-packages/landscape/schema.pyt<module>s$

Youez - 2016 - github.com/yon3zu
LinuXploit