HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1991111/root/usr/lib/python3/dist-packages/jsonschema/__pycache__/
Upload File :
Current File : //proc/1991111/root/usr/lib/python3/dist-packages/jsonschema/__pycache__/cli.cpython-311.pyc
�

�r�c/ ��~�dZddlmZddlmZddlZddlZddlZddlZ	ddlm	Z	n#e
$rddlZ	YnwxYw	ddlm
Z
n#e
$r	ddlm
Z
YnwxYwddlZddlmZddlmZmZGd	�d
e��ZejGd�de����ZejGd
�de����ZejGd�de����Zd�Zejd���Ze�ddddd���e�ddd���e�ddd d!gd d"�#��e�d$d%ed&�'��e�d(d)���e�d*d+e	j d,���-��e�d.d/���d0�Z!d1�Z"ej#d2d�fd3�Z$ej%ej&ej'fd4�Z(dS)5z"
The ``jsonschema`` command line.
�)�JSONDecodeError)�dedentN)�metadata��resolve_name)�SchemaError)�RefResolver�
validator_forc��eZdZdS)�_CannotLoadFileN)�__name__�
__module__�__qualname__���0/usr/lib/python3/dist-packages/jsonschema/cli.pyrrs�������Drrc��eZdZej��Zej��Zej��Zed���Z	d�Z
d�Zd�Zd�Z
d�ZdS)�
_Outputterc��|ddkrt|d��}n|ddkrt��}||||���S)N�output�plain�error_format�pretty)�	formatter�stdout�stderr)�_PlainFormatter�_PrettyFormatter)�cls�	argumentsrrrs     r�from_argumentsz_Outputter.from_arguments'sX���X��'�)�)�'�	�.�(A�B�B�I�I�
�x�
 �H�
,�
,�(�*�*�I��s�Y�v�f�E�E�E�Erc��	t|��}nD#t$r7|�|tj�����t���wxYw|5	t
j|��cddd��S#t$r7|�	|tj�����t���wxYw#1swxYwYdS)N��path�exc_info)
�open�FileNotFoundError�filenotfound_error�sysr%r�json�loadr�
parsing_error)�selfr$�files   rr+z_Outputter.load/s��	$���:�:�D�D�� �	$�	$�	$��#�#������#�G�G�G�!�#�#�#�	$�����	(�	(�
(��y����	(�	(�	(�	(�	(�	(�	(�	(��#�
(�
(�
(��"�"��s�|�~�~�"�F�F�F�%�'�'�'�
(����	(�	(�	(�	(����	(�	(�	(�	(�	(�	(s/��AA�B>�A:�:AB;�;B>�>C�Cc�Z�|j�|jjdi|����dS�Nr)�_stderr�write�
_formatterr(�r-�kwargss  rr(z_Outputter.filenotfound_error=�4������=�4�?�=�G�G��G�G�H�H�H�H�Hrc�Z�|j�|jjdi|����dSr0)r1r2r3r,r4s  rr,z_Outputter.parsing_error@s4������8�4�?�8�B�B�6�B�B�C�C�C�C�Crc�Z�|j�|jjdi|����dSr0)r1r2r3�validation_errorr4s  rr9z_Outputter.validation_errorCs4������;�4�?�;�E�E�f�E�E�F�F�F�F�Frc�Z�|j�|jjdi|����dSr0)�_stdoutr2r3�validation_successr4s  rr<z_Outputter.validation_successFr6rN)r
rr�attr�ibr3r;r1�classmethodr!r+r(r,r9r<rrrrr s������������J��d�g�i�i�G��d�g�i�i�G��F�F��[�F�(�(�(�I�I�I�D�D�D�G�G�G�I�I�I�I�Irrc�@�eZdZed��ZdZd�Zd�Zd�Zd�Z	dS)rz`        ===[{type}]===({path})===

        {body}
        -----------------------------
        z===[SUCCESS]===({path})===
c�b�|j�|dd�|�����S)Nr'z{!r} does not exist.�r$�type�body)�
_ERROR_MSG�format�r-r$r%s   rr(z#_PrettyFormatter.filenotfound_errorWs8����%�%��$�'�.�.�t�4�4�&�
�
�	
rc��|\}}}d�tj|||����}|j�||j|���S)N�rB)�join�	traceback�format_exceptionrErFr
)r-r$r%�exc_type�	exc_value�
exc_traceback�	exc_liness       rr,z_PrettyFormatter.parsing_error^s`��-5�*��)�]��G�G��&�x��M�J�J�
�
�	���%�%���"��&�
�
�	
rc�P�|j�||jj|���S)NrB)rErF�	__class__r
�r-�
instance_path�errors   rr9z!_PrettyFormatter.validation_erroris/����%�%����)��&�
�
�	
rc�8�|j�|���S)N)r$)�_SUCCESS_MSGrF�r-rTs  rr<z#_PrettyFormatter.validation_successps��� �'�'�]�'�;�;�;rN)
r
rrrrErWr(r,r9r<rrrrrJso��������	���J�2�L�
�
�
�	
�	
�	
�
�
�
�<�<�<�<�<rrc�D�eZdZej��Zd�Zd�Zd�Zd�Z	dS)rc�,�d�|��S)Nz{!r} does not exist.
)rFrGs   rr(z"_PlainFormatter.filenotfound_errorys��'�.�.�t�4�4�4rc�d�d�|dkrdnt|��|d��S)NzFailed to parse {}: {}
�<stdin>�)rF�reprrGs   rr,z_PlainFormatter.parsing_error|s8��)�0�0���*�*�I�I��T�
�
��Q�K�
�
�	
rc�:�|j�||���S)N)�	file_namerU)�
_error_formatrFrSs   rr9z _PlainFormatter.validation_error�s���!�(�(�=��(�N�N�Nrc��dS)NrIrrXs  rr<z"_PlainFormatter.validation_success�s���rrN)
r
rrr=r>rar(r,r9r<rrrrrtsb�������D�G�I�I�M�5�5�5�
�
�
�O�O�O�����rrc�2�d|vrd|z}t|��S)N�.zjsonschema.r)�names r�_resolve_name_with_defaultrf�s#��
�$����t�#������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). If no instances are provided via this
        option, one will be expected on standard input.
    )�action�dest�helpz-Fz--error-formata�
        the format to use for each validation error message, specified
        in a form suitable for str.format. This string will be passed
        one formatted object named 'error' for each ValidationError.
        Only provide this option when using --output=plain, which is the
        default. If this argument is unprovided and --output=plain is
        used, a simple default representation will be used.
    )rlz-oz--outputrrz�
        an output format to use. 'plain' (default) will produce minimal
        text with one line for each error, while 'pretty' will produce
        more detailed human-readable output on multiple lines.
    )�choices�defaultrlz-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.
    )rCrlz
--base-uriz�
        a base URI to assign to the provided schema, even if it does not
        declare one (via e.g. $id). This option can be used if you wish to
        resolve relative references to a particular URI (or local path)
    z	--version�version�
jsonschema)rjro�schemaz=the path to a JSON Schema to validate with (i.e. schema.json)c���tt�|pdg�����}|ddkr"|drt�d���|ddkr
|d�d|d<|S)Nz--help��argsrrrz3--error-format can only be used with --output plainz"{error.instance}: {error.message}
)�vars�parser�
parse_argsrU)rtr s  rrwrw�s����V�&�&�D�,>�X�J�&�?�?�@�@�I����g�%�%�)�N�*C�%��l�l�A�
�
�	
����g�%�%�)�N�*C�*K�$I�	�.�!��rc��d}|�|��D]}d}|�||����|s|�|���|S)NFT�rTrU)rT)�iter_errorsr9r<)rT�instance�	validator�	outputter�invalidrUs      r�_validate_instancer�sl���G��&�&�x�0�0�M�M�����"�"��e�"�L�L�L�L��B��$�$�=�$�A�A�A��Nrr]c�f�tjtt|��������dS)Nrs)r )r)�exit�runrwrss r�mainr��s.���H�S�:�4�0�0�0�
1�
1�
1�2�2�2�2�2rc���
�t�|||����
	�
�|d��}n#t$rYdSwxYw|d�t	|��|d<	|d�|��n5#t$r(}�
�|d|���Yd}~dSd}~wwxYw|dr�
j|d}}n	�
�fd�}dg}|d	�t|d	|�
��nd}|d||���}	d}
|D]6}	||��}|
t|||	�
�
��z}
�%#t$rd}
Y�3wxYw|
S)N)r rrrqr]r|ryric���	tj���S#t$r7��dt	j�����t
���wxYw)Nr\r#)r*r+rr,r)r%r)�_r}�stdins ��rr+zrun.<locals>.loadsi���
(��y��'�'�'��"�
(�
(�
(��'�'�"�S�\�^�^�(����&�'�'�'�	
(���s
��AAr\�base_uri)r��referrer)�resolverr)rTr{r|r})
rr!r+rr
�check_schemarr9r	r)r rrr�rqrUr+rir�r|�	exit_code�eachr{r}s   `         @rr�r��s�����)�)����*���I�����	�(� 3�4�4���������q�q��������%�!.�v�!6�!6�	�+����+��+�+�F�3�3�3�3�������"�"�#�H�-��	#�	
�	
�	
��q�q�q�q�q������������ �#�.�)�K�*@�i���	(�	(�	(�	(�	(�	(��K�	�

�:�	�	*���:�&������15�
�
'�	�+�&�v��A�A�A�I��I�����
	��t�D�z�z�H�
�+�"�!�#�#�	���
�I�I���	�	�	��I�I�I�	�����s9�=�
A�
A�)B�
B7�B2�2B7�D8�8E�E))�__doc__r*r�textwrapr�argparser)rK�	importlibr�ImportError�importlib_metadata�pkgutilr�pkgutil_resolve_namer=�jsonschema.exceptionsr�jsonschema.validatorsr	r
�	Exceptionr�s�objectrrrrf�ArgumentParserrv�add_argumentrorwr�argvr�rrr�r�rrr�<module>r�s�����!� � � � � ���������������
�
�
�
�����*�"�"�"�"�"�"�"���*�*�*�)�)�)�)�)�)�*����2�$�$�$�$�$�$�$���2�2�2�1�1�1�1�1�1�1�1�2��������-�-�-�-�-�-�<�<�<�<�<�<�<�<�	�	�	�	�	�i�	�	�	���&I�&I�&I�&I�&I��&I�&I���&I�R��&<�&<�&<�&<�&<�v�&<�&<���&<�R�������f������(���
!��	 �,�
�
�
������,��	�
�	�	�	�	�����
�
��
�
�
�����*�
�h���
�	�	�	�	�����-�	#�
���������
�����������H��\�*�*�����
����	H������������h�q�r�r�l�3�3�3�3��*�S�Z�s�y�9�9�9�9�9�9s�'�	3�3�>�A�A