Your IP : 18.191.44.145


Current Path : /opt/alt/python37/lib/python3.7/site-packages/jsonschema/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/jsonschema/__pycache__/cli.cpython-37.opt-1.pyc

B

�pSe	�@s�dZddlmZddlZddlZddlZddlmZddlm	Z	ddl
mZdd�Zd	d
�Z
ejdd�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|krd|}t|�S)N�.zjsonschema.)r)�name�r�?/opt/alt/python37/lib/python3.7/site-packages/jsonschema/cli.py�_namedAnyWithDefaultsr
c	Cst|��}t�|�SQRXdS)N)�open�json�load)�path�filerrr	�
_json_files
rzJSON Schema Validation CLI)Zdescriptionz-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��}|ddkr2t|d�|d<|S)Nz--help)�args�	validatorr)�vars�parser�
parse_argsr)r�	argumentsrrr	rDsr�cCst�tt|d�d��dS)N)r)r)�sys�exit�runr)rrrr	�mainKsr$cCsp|d}|d|dd�}|�|d�d}x>|dp8dD].}x(|�|�D]}|�|j|d��d	}qJWq:W|S)
N�error_formatrr)rFrr)�errorT)Zcheck_schemaZiter_errors�write�format)r�stdout�stderrr%rZerrored�instancer&rrr	r#Osr#)�__doc__Z
__future__r�argparserr!Z
jsonschemarZjsonschema._reflectrZjsonschema.validatorsrr
r�ArgumentParserr�add_argumentr�argvr$r)r*r#rrrr	�<module>sH

?>