/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/_format.pyc (9035B)
Ñò DVc@sÄddkZddkZddkZddklZddklZdefd„ƒYZhgd6gd6Z dddd&d„Z e d ƒd „ƒZ ei d ƒZe dd dd ƒd„ƒZeedƒo"e ddeiƒd„ƒZnei dƒZe ddddƒd„ƒZyddkZWnej onXe ddeƒd„ƒZyddkZWn]ej oQyddkZWnej oqêXe ddeeifƒd„ƒZnXe dƒd„ƒZe ddeiƒd„ƒZe dddeƒd„ƒZe dd deƒd!„ƒZyddkZWnej on8Xd"„Z e dd#dee!fƒd$„ƒZ"d%„Z#ee dƒZ$ee dƒZ%dS('iÿÿÿÿN(t str_types(t FormatErrort FormatCheckercBsJeZdZhZdd„Zdd„ZeeƒZd„Z d„Z RS(s  A ``format`` property checker. JSON Schema does not mandate that the ``format`` property actually do any validation. If validation is desired however, instances of this class can be hooked into validators to enable format validation. :class:`FormatChecker` objects always return ``True`` when asked about formats that they do not know how to validate. To check a custom format using a function that takes an instance and returns a ``bool``, use the :meth:`FormatChecker.checks` or :meth:`FormatChecker.cls_checks` decorators. :argument iterable formats: the known formats to validate. This argument can be used to limit which formats will be used during validation. csF|djoˆiiƒˆ_n t‡fd†|Dƒƒˆ_dS(Nc3s&x|]}|ˆi|fVqWdS(N(tcheckers(t.0tk(tself(s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pys $s (tNoneRtcopytdict(Rtformats((Rs6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pyt__init__ s cs‡‡‡fd†}|S(s´ Register a decorated function as validating a new format. :argument str format: the format that the decorated function will check :argument Exception raises: the exception(s) raised by the decorated function when an invalid instance is found. The exception object will be accessible as the :attr:`ValidationError.cause` attribute of the resulting validation error. cs|ˆfˆiˆ<|S(N(R(tfunc(Rtraisestformat(s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pyt_checks2s((RRR R((RR Rs6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytchecks&s cCs||ijodS|i|\}}d\}}y||ƒ}Wn|j o}|}nX|p td||fd|ƒ‚ndS(sH Check whether the instance conforms to the given format. :argument instance: the instance to check :type: any primitive type (str, number, bool) :argument str format: the format that instance should conform to :raises: :exc:`FormatError` if instance does not conform to format Ns%r is not a %rtcause(NN(RRR(RtinstanceRR R tresultRte((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytcheck9s   cCs3y|i||ƒWntj otSXtSdS(s Check whether the instance conforms to the given format. :argument instance: the instance to check :type: any primitive type (str, number, bool) :argument str format: the format that instance should conform to :rtype: bool N(RRtFalsetTrue(RRR((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytconformsRs N(( t__name__t __module__t__doc__RRR Rt classmethodt cls_checksRR(((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pyR s    tdraft3tdraft4cs3ˆp|‰ˆp|‰‡‡‡fd†}|S(Ncslˆo-tdiˆƒtiˆˆƒ|ƒ}nˆo-tdiˆƒtiˆˆƒ|ƒ}n|S(NRR(t_draft_checkerstappendRR(R (RRR (s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytwrapls((tbothRRR R"((R RRs6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pyt_checks_draftshs  temailcCst|tƒptSd|jS(Nt@(t isinstanceRR(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytis_emailwss$^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$s ip-addresstipv4cCsGt|tƒptSti|ƒptStd„|idƒDƒƒS(Ncss6x/|](}dt|ƒjo djnVqWdS(iiÿN(tint(Rt component((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pys †s t.(R'RRt_ipv4_retmatchRtalltsplit(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytis_ipv4€s t inet_ptontipv6R cCs(t|tƒptStiti|ƒS(N(R'RRtsocketR2tAF_INET6(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytis_ipv6Šss#^[A-Za-z0-9][A-Za-z0-9\.\-]{1,255}$s host-namethostnamecCsft|tƒptSti|ƒptS|idƒ}x&|D]}t|ƒdjotSq@WtS(NR,i?(R'RRt _host_name_reR.RR0tlen(Rt componentsR+((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pyt is_host_name“s turicCs(t|tƒptSti|ddƒS(NtruletURI(R'RRtrfc3987tparse(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytis_uri¥ss date-timecCs"t|tƒptSti|ƒS(N(R'RRtisodatetparse_datetime(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytis_date´scCs"t|tƒptSti|ƒS(N(R'RRtstrict_rfc3339tvalidate_rfc3339(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pyRDºstregexcCs"t|tƒptSti|ƒS(N(R'RRtretcompile(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytis_regexÁstdatecCs(t|tƒptStii|dƒS(Ns%Y-%m-%d(R'RRtdatetimetstrptime(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pyRDÈsttimecCs(t|tƒptStii|dƒS(Ns%H:%M:%S(R'RRRLRM(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytis_timeÏscCs ti|ƒS(N(t webcolorst normalize_hex(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytis_css_color_codeÛstcolorcCs6t|tƒ p|iƒtijotSt|ƒS(N(R'RtlowerRPtcss21_names_to_hexRRR(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytis_css21_colorßscCs%|iƒtijotSt|ƒS(N(RTRPtcss3_names_to_hexRRR(R((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pyt is_css3_colorés((&RLRHR4tjsonschema.compatRtjsonschema.exceptionsRtobjectRR RR$R(RIR-R1thasattrterrorR6R8R;R?t ImportErrort ValueErrorRARERBt ISO8601ErrorRDRJRORPRRt TypeErrorRVRXtdraft3_format_checkertdraft4_format_checker(((s6/tmp/pip-build-lt8jXN/jsonschema/jsonschema/_format.pytsP   \ " ) $