ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ ]c@ sddlmZddlZddlZddlZyddlZWnek r]dZnXddlm Z m Z ddl m Z m Z mZmZmZmZmZmZmZmZddlmZddlmZmZmZe jZiZe jZdZ d0dddZ!dd Z"e!d e j#d d ie j$d 6e j%d6e j&d6e j'd6e j(d6e j)d6e j*d6e j+d6e j,d6e j-d6e j.d6e j/d6e j0d6e j1d6e j2d6e j3d6e j)d6e j4d6e j5d6e j6d 6e j7d!6e j8d"6d#d Z9e!d e j#d$d ie j$d 6e j%d6e j&d6e j:d%6e j;d&6e j'd6e j*d6e j,d6e j-d6e j.d6e j/d6e j<d'6e j0d6e j1d6e j2d6e j=d(6e j3d6e j)d6e j>d)6e j?d*6e j4d6e j5d6e j@d 6e jAd+6e jBd!6e j8d"6d#d$ZCd,eDfd-YZEed.ZFdd/ZGdS(1i(tdivisionN(t_utilst _validators( tSequenceturljointurlsplitt urldefragtunquoteturlopent str_typest int_typest iteritemst lru_cache(t ErrorTree(tRefResolutionErrort SchemaErrort UnknownTypec sfd}|S(s Register the decorated validator for a ``version`` of the specification. Registered validators and their meta schemas will be considered when parsing ``$schema`` properties' URIs. Arguments: version (str): An identifier to use as the version's name Returns: callable: a class decorator to decorate the validator with the version c s1|ts( RRR"t isinstancetboolRtflattentanytFalse(R#R,ttypetpytypest is_number((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pytis_types cS s%t|j||d}|dkS(N(tnextR&R(R#R,R4R(((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pytis_valids(N(t__name__t __module__RR/RRRR%t classmethodR)R&R;R>RLRN((t default_typest meta_schemaR(sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyR>s     #  t t(RtlistRER RIR@RARR tobjectRttitletreplaceRO(RSRRRRR((RRRSRsF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pytcreate6s  "Y "c C sAt|j}|j|td|jd|d|d|jS(NRSRRRR(RR/RRZRR(R*RRtall_validators((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pytextends  RStdraft3Ru$refuadditionalItemsuadditionalPropertiesu dependenciesudisallowu divisibleByuenumuextendsuformatuitemsumaxItemsu maxLengthumaximumuminItemsu minLengthuminimumu multipleOfupatternupatternPropertiesu propertiesutypeu uniqueItemsRtdraft4uallOfuanyOfu maxPropertiesu minPropertiesunotuoneOfurequiredRcB seZdZd eddddZedZdZdZ e dZ e dZ e jdZe jdZd Zd Zd Zd ZRS(s( Resolve JSON References. Arguments: base_uri (str): The URI of the referring document referrer: The actual referring document store (dict): A mapping from URIs to documents to cache cache_remote (bool): Whether remote refs should be cached after first resolution handlers (dict): A mapping from URI schemes to functions that should be used to retrieve them urljoin_cache (repoze.lru.lru_cache): A cache that will be used for caching the results of joining the resolution scope to subscopes. remote_cache (repoze.lru.lru_cache): A cache that will be used for caching the results of resolved remote URLs. cC s|dkr!tdt}n|dkrEtd|j}n||_||_t||_|g|_t j dt t D|_ |j j|||j |<||_||_dS(Nics s$|]\}}||jfVqdS(N(R(RBtidR*((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pys $s(RR Rtresolve_from_urltreferrert cache_remoteRthandlerst _scopes_stackRtURIDictR RtstoreRt_urljoin_cachet _remote_cache(R#tbase_uriRaRfRbRct urljoin_cachet remote_cache((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyR%s       cO s||jdd|||S(s Construct a resolver from a JSON schema object. Arguments: schema: the referring schema Returns: :class:`RefResolver` uidu(R-(RR"R<R=((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyR-scC s#|jj|j|j|dS(N(RdtappendRgtresolution_scope(R#R5((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyR.@s cC s5y|jjWntk r0tdnXdS(NsnFailed to pop the scope from an empty stack. `pop_scope()` should only be called once for every `push_scope()`(Rdtpopt IndexErrorR(R#((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyR3Es  cC s |jdS(Ni(Rd(R#((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyRmOscC st|j\}}|S(N(RRm(R#turit_((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyRiSscc s(|j|z dVWd|jXdS(N(R.R3(R#R5((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pytin_scopeXs  cc s=|j|\}}|j|z |VWd|jXdS(s Context manager which resolves a JSON ``ref`` and enters the resolution scope of this ref. Arguments: ref (str): The reference to resolve N(tresolveR.R3(R#R6turltresolved((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyt resolving`s   cC s(|j|j|}||j|fS(N(RgRmRh(R#R6Rt((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyRsuscC s|t|\}}y|j|}WnFtk rky|j|}Wqltk rg}t|qlXnX|j||S(N(RRftKeyErrortresolve_remotet ExceptionRtresolve_fragment(R#Rttfragmenttdocumenttexc((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyR`ys cC s|jd}|r*t|jdng}x|D]}|jddjdd}t|tryt|}Wqtk rqXny||}Wq7tt fk rt d|q7Xq7W|S(s Resolve a ``fragment`` within the referenced ``document``. Arguments: document: The referrant document fragment (str): a URI fragment to resolve within it u/u~1u~0u~sUnresolvable JSON pointer: %r( tlstripRtsplitRYRDRtintt ValueErrort TypeErrort LookupErrorR(R#R|R{tpartstpart((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyRzs!  cC st|j}||jkr4|j||}n|dkrtrttjdddk rttjjrtj |j}qtj |j}n$tj t |j j d}|jr||j|>> validate([2, 3, 4], {"maxItems": 2}) Traceback (most recent call last): ... ValidationError: [2, 3, 4] is too long :func:`validate` will first verify that the provided schema is itself valid, since not doing so can lead to less obvious error messages and fail in less obvious or consistent ways. If you know you have a valid schema already or don't care, you might prefer using the :meth:`~IValidator.validate` method directly on a specific validator (e.g. :meth:`Draft4Validator.validate`). Arguments: instance: The instance to validate schema: The schema to validate with cls (:class:`IValidator`): The class that will be used to validate the instance. If the ``cls`` argument is not provided, two things will happen in accordance with the specification. First, if the schema has a :validator:`$schema` property containing a known meta-schema [#]_ then the proper validator will be used. The specification recommends that all schemas contain :validator:`$schema` properties for this reason. If no :validator:`$schema` property is found, the default validator class is :class:`Draft4Validator`. Any other provided positional and keyword arguments will be passed on when instantiating the ``cls``. Raises: :exc:`ValidationError` if the instance is invalid :exc:`SchemaError` if the schema itself is invalid .. rubric:: Footnotes .. [#] known by a validator registered with :func:`validates` N(RRR)R>(R,R"RR<R=((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyR>s3  ((Ht __future__RRRR@Rt ImportErrorRt jsonschemaRRtjsonschema.compatRRRRRRR R R R tjsonschema.exceptionsR RRRtUnsetRRReRRRZR\t load_schemaR6tadditionalItemstadditionalPropertiest dependenciestdisallow_draft3t multipleOftenumtextends_draft3tformattitemstmaxItemst maxLengthtmaximumtminItemst minLengthtminimumtpatterntpatternPropertiestproperties_draft3t type_draft3t uniqueItemstDraft3Validatort allOf_draft4t anyOf_draft4tmaxProperties_draft4tminProperties_draft4t not_draft4t oneOf_draft4tproperties_draft4trequired_draft4t type_draft4RRWRRR>(((sF/opt/alt/python27/lib/python2.7/site-packages/jsonschema/validators.pyts     F   h