HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/__pycache__/json.cpython-310.pyc
o

��h��
@s\ddlmZddlmZmZddlmZmZmZm	Z	ddl
mZddlm
Z
mZGdd�d�Zed	kr�dd
lZdd
lZejdd�Zejd
ddd�ejdddeddd�e��ZddlmZe�Zedd�Zzejdkrrej��Z neej��!�Z Wn#e"y�Z#ze�$dej�de#���e�%d�WYd
Z#[#nd
Z#[#wwej$ee ej&d�dd�d
Sd
S) �)�Path)�loads�dumps)�Any�Callable�Optional�Union�)�Text)�JSONHighlighter�NullHighlighterc@s�eZdZdZ								ddededeefded	ed
ededed
ee	e
ge
fdeddfdd�Ze								dde
dedeefded	ed
ededed
ee	e
ge
fdeddfdd��Z
defdd�ZdS)�JSONa_A renderable which pretty prints JSON.

    Args:
        json (str): JSON encoded data.
        indent (Union[None, int, str], optional): Number of characters to indent by. Defaults to 2.
        highlight (bool, optional): Enable highlighting. Defaults to True.
        skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
        ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
        check_circular (bool, optional): Check for circular references. Defaults to True.
        allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
        default (Callable, optional): A callable that converts values that can not be encoded
            in to something that can be JSON encoded. Defaults to None.
        sort_keys (bool, optional): Sort dictionary keys. Defaults to False.
    �TFN�json�indent�	highlight�	skip_keys�ensure_ascii�check_circular�	allow_nan�default�	sort_keys�returnc

CsNt|�}
t|
|||||||	d�}|rt�nt�}||�|_d|j_d|j_dS)N�r�skipkeysrrrrrT)rrrr�text�no_wrap�overflow)�selfrrrrrrrrr�data�highlighter�r!�@/usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/json.py�__init__s�

z
JSON.__init__rc


CsP|�|�}
t||||||||	d�}|rt�nt�}||�|
_d|
j_d|
j_|
S)a|Encodes a JSON object from arbitrary data.

        Args:
            data (Any): An object that may be encoded in to JSON
            indent (Union[None, int, str], optional): Number of characters to indent by. Defaults to 2.
            highlight (bool, optional): Enable highlighting. Defaults to True.
            default (Callable, optional): Optional callable which will be called for objects that cannot be serialized. Defaults to None.
            skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
            ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
            check_circular (bool, optional): Check for circular references. Defaults to True.
            allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
            default (Callable, optional): A callable that converts values that can not be encoded
                in to something that can be JSON encoded. Defaults to None.
            sort_keys (bool, optional): Sort dictionary keys. Defaults to False.

        Returns:
            JSON: New JSON object from the given data.
        rTN)�__new__rrrrrr)
�clsrrrrrrrrr�
json_instancerr r!r!r"�	from_data5s 
�

zJSON.from_datacCs|jS)N)r)rr!r!r"�__rich__esz
JSON.__rich__)rTFFTTNF)�__name__�
__module__�__qualname__�__doc__�strr�int�boolrrrr#�classmethodr'r
r(r!r!r!r"r
	s|��������	�
�
���������	�
��/r
�__main__NzPretty print json)�description�path�PATHzpath to file, or - for stdin)�metavar�helpz-iz--indent�SPACESzNumber of spaces in an indentr)r5�typer6r)�ConsoleT)�stderr�-zUnable to read z; ���)r)�	soft_wrap)'�pathlibrrrr�typingrrrrrr
r rrr
r)�argparse�sys�ArgumentParser�parser�add_argumentr.�
parse_args�args�pip._vendor.rich.consoler9�console�
error_consoler3�stdin�read�	json_data�	read_text�	Exception�error�print�exitrr!r!r!r"�<module>sN`��

����