/usr/lib/python2.6/site-packages/jsonschema
NameSizeModeActions
schemas/-0755rm
tests/-0755rm
cli.py20140644editdlrm
cli.pyc28450644editdlrm
compat.py15530644editdlrm
compat.pyc19680644editdlrm
exceptions.py69730644editdlrm
exceptions.pyc109020644editdlrm
validators.py159210644editdlrm
validators.pyc163410644editdlrm
_format.py68810644editdlrm
_format.pyc90350644editdlrm
_reflect.py50230644editdlrm
_reflect.pyc55270644editdlrm
_utils.py49810644editdlrm
_utils.pyc84160644editdlrm
_validators.py117900644editdlrm
_validators.pyc129600644editdlrm
_version.py1220644editdlrm
_version.pyc2320644editdlrm
__init__.py6790644editdlrm
__init__.pyc10210644editdlrm
__main__.py390644editdlrm
__main__.pyc2100644editdlrm
Edit: /usr/lib/python2.6/site-packages/jsonschema/validators.pyc (16341B)
Ñò DVc@ s‡ddklZddkZddkZddkZyddkZWnej o dZnXddkl Z l Z ddk l Z l Z lZlZlZlZlZlZlZlZddklZddklZlZlZe iƒZhZe iƒZd„Z d0ddd„Z!dd „Z"e!d e i#d ƒd he i$d 6e i%d6e i&d6e i'd6e i(d6e i)d6e i*d6e i+d6e i,d6e i-d6e i.d6e i/d6e i0d6e i1d6e i2d6e i3d6e i)d6e i4d6e i5d6e i6d 6e i7d!6e i8d"6d#d ƒZ9e!d e i#d$ƒd he i$d 6e i%d6e i&d6e i:d%6e i;d&6e i'd6e i*d6e i,d6e i-d6e i.d6e i/d6e i<d'6e i0d6e i1d6e i2d6e i=d(6e i3d6e i)d6e i>d)6e i?d*6e i4d6e i5d6e i@d 6e iAd+6e iBd!6e i8d"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 s‡fd†}|S(sY Register the decorated validator for a ``version`` of the specification. Registered validators and their meta schemas will be considered when parsing ``$schema`` properties' URIs. :argument str version: an identifier to use as the version's name :returns: a class decorator to decorate the validator with the version c s3|tˆ†s ( RRR"t isinstancetboolRtflattentanytFalse(R#R,ttypetpytypest is_number((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pytis_type}s  cS s%t|i||ƒdƒ}|djS(N(tnextR&R(R#R,R4R(((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pytis_validŒs(N(t__name__t __module__RR/RRRR%t classmethodR)R&R;R>RLRN((t meta_schemaRt default_types(s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyR7s     #  t t(RtlistRER RIR@RARR tobjectRttitletreplaceRO(RRRRRSR((RSRRRs9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pytcreate/s "Y #c C sAt|iƒ}|i|ƒtd|id|d|d|iƒS(NRRRRRS(RR/RRZRR(R*RRtall_validators((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pytextend—s  RRtdraft3Ru$refuadditionalItemsuadditionalPropertiesu dependenciesudisallowu divisibleByuenumuextendsuformatuitemsumaxItemsu maxLengthumaximumuminItemsu minLengthuminimumu multipleOfupatternupatternPropertiesu propertiesutypeu uniqueItemsRtdraft4uallOfuanyOfu maxPropertiesu minPropertiesunotuoneOfurequiredRcB s­eZdZd edddd„Zed„ƒZd„Zd„Z e d„ƒZ e d„ƒZ e id„ƒZe id„ƒZd „Zd „Zd „Zd „ZRS(sÍ Resolve JSON References. :argument str base_uri: URI of the referring document :argument referrer: the actual referring document :argument dict store: a mapping from URIs to documents to cache :argument bool cache_remote: whether remote refs should be cached after first resolution :argument dict handlers: a mapping from URI schemes to functions that should be used to retrieve them :arguments functools.lru_cache urljoin_cache: a cache that will be used for caching the results of joining the resolution scope to subscopes. :arguments functools.lru_cache remote_cache: a cache that will be used for caching the results of resolved remote URLs. cC sË|djotdƒtƒ}n|djotdƒ|iƒ}n||_||_t|ƒ|_|g|_t i d„t t ƒDƒƒ|_ |i i|ƒ||i |<||_||_dS(Nics s(x!|]\}}||ifVqWdS(N(R(RBtidR*((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pys s (RR Rtresolve_from_urltreferrert cache_remoteRthandlerst _scopes_stackRtURIDictR RtstoreRt_urljoin_cachet _remote_cache(R#tbase_uriRaRfRbRct urljoin_cachet remote_cache((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyR%ós       cO s||iddƒ|||ŽS(s— Construct a resolver from a JSON schema object. :argument schema: the referring schema :rtype: :class:`RefResolver` uidu(R-(RR"R<R=((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyRs cC s#|ii|i|i|ƒƒdS(N(RdtappendRgtresolution_scope(R#R5((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyR.s cC s7y|iiƒWntj otdƒ‚nXdS(NsnFailed to pop the scope from an empty stack. `pop_scope()` should only be called once for every `push_scope()`(Rdtpopt IndexErrorR(R#((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyR3"s cC s |idS(Niÿÿÿÿ(Rd(R#((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyRm,scC st|iƒ\}}|S(N(RRm(R#turit_((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyRi0scc s(|i|ƒz dVWd|iƒXdS(N(R.R3(R#R5((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pytin_scope5s  cc s=|i|ƒ\}}|i|ƒz |VWd|iƒXdS(s¦ Context manager which resolves a JSON ``ref`` and enters the resolution scope of this ref. :argument str ref: reference to resolve N(tresolveR.R3(R#R6turltresolved((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyt resolving=s   cC s(|i|i|ƒ}||i|ƒfS(N(RgRmRh(R#R6Rt((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyRsNscC s€t|ƒ\}}y|i|}WnJtj o>y|i|ƒ}Wqptj o}t|ƒ‚qpXnX|i||ƒS(N(RRftKeyErrortresolve_remotet ExceptionRtresolve_fragment(R#Rttfragmenttdocumenttexc((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyR`Rsc C sÙ|idƒ}|ot|ƒidƒng}x |D]˜}|iddƒiddƒ}t|tƒo*yt|ƒ}Wq—tj oq—Xny||}Wq9tt fj ot d|ƒ‚q9Xq9W|S(sÅ Resolve a ``fragment`` within the referenced ``document``. :argument document: the referrant document :argument str fragment: a URI fragment to resolve within it u/u~1u~0u~sUnresolvable JSON pointer: %r( tlstripRtsplitRYRDRtintt ValueErrort TypeErrort LookupErrorR(R#R|R{tpartstpart((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyRz^s # cC sët|ƒi}||ijo|i||ƒ}n—|djoeto^ttiddƒdj oBttiiƒoti |ƒiƒ}qÌti |ƒi}n%ti t |ƒi ƒi dƒƒ}|io||i|>> 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`). :argument instance: the instance to validate :argument schema: the schema to validate with :argument cls: an :class:`IValidator` 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(RR˜R)R>(R,R"RR<R=((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyR>²s)  ((Ht __future__RR“R†R@Rˆt ImportErrorRt jsonschemaRRtjsonschema.compatRRRRRRR R R R tjsonschema.exceptionsR RRRtUnsetR•RReRRRZR\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_draft4R–RWRR˜R>(((s9/tmp/pip-build-lt8jXN/jsonschema/jsonschema/validators.pyts˜    F   h                                                   Ë