a E®s] ã@södZddlmZddlZddlZddlZddlmZddlm Z ddl m Z dd„Z d d „Z ejd d �Zejd ddde dd�ejddddd�ejdde dd�ejdded�ejdd e d!�d"d#„Zejd$d…fd%d&„Zejejfd'd(„ZdS))z" The ``jsonschema`` command line. é)Úabsolute_importN)Ú __version__©ÚnamedAny)Ú validator_forcCsd|vrd|}t|ƒS)NÚ.z jsonschema.r)Úname©r ú2/usr/lib/python3.9/site-packages/jsonschema/cli.pyÚ_namedAnyWithDefaultsr cCs6t|ƒ�}t |¡WdƒS1s(0YdS)N)ÚopenÚjsonÚload)ÚpathÚfiler r r Ú _json_files rzJSON Schema Validation CLI)Ú descriptionz-iz --instanceÚappendÚ instancesz\a path to a JSON instance (i.e. filename.json) to validate (may be specified multiple times))ÚactionÚdestÚtypeÚhelpz-Fz--error-formatz"{error.instance}: {error.message} z™the format to use for each error output message, specified in a form suitable for passing to str.format, which will be called with 'error' for each error)Údefaultrz-Vz --validatorzŒthe fully qualified object name of a validator to use, or, for validators that are registered with jsonschema, simply the name of the class.)rrz --versionÚversion)rrÚschemaz3the JSON Schema to validate with (i.e. schema.json))rrcCs6ttj|pdgd�ƒ}|ddur2t|dƒ|d<|S)Nz--help©ÚargsÚ validatorr)ÚvarsÚparserÚ parse_argsr)rÚ argumentsr r r r!Ds r!écCst tt|d�d�¡dS)Nr)r")ÚsysÚexitÚrunr!rr r r ÚmainKsr'cCsh|d}|d|dd�}| |d¡d}|dp6dD]*}| |¡D]}| |j|d�¡d }qFq8|S) NÚ error_formatrr)rFrr )ÚerrorT)Z check_schemaZ iter_errorsÚwriteÚformat)r"ÚstdoutÚstderrr(rZerroredÚinstancer)r r r r&Osr&)Ú__doc__Z __future__rÚargparser r$Z jsonschemarZjsonschema._reflectrZjsonschema.validatorsrr rÚArgumentParserr Ú add_argumentr!Úargvr'r,r-r&r r r r ÚsT    ÿú ü ü ýý