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/_internal/utils/__pycache__/logging.cpython-310.pyc
o

��hL/�@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZddlmZddlmZmZddlmZmZmZmZmZmZdd	lmZdd
lmZddlmZddl m!Z!dd
l"m#Z#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*e�+�Z,da-dZ.e$d�Z/Gdd�de0�Z1d>dd�Z2ej3d?d@d d!��Z4dAd"d#�Z5Gd$d%�d%ej6�Z7eGd&d'�d'��Z8Gd(d)�d)e�Z9d*d+�dBd.d/�Z:Gd0d1�d1e�Z;Gd2d3�d3ej<j=�Z>Gd4d5�d5e�Z?Gd6d7�d7e�Z@dCd<d=�ZAdS)D�)�annotationsN)�	Generator)�	dataclass)�
TextIOWrapper)�Filter)�Any�ClassVar)�Console�ConsoleOptions�ConsoleRenderable�RenderableType�RenderResult�RichCast)�NullHighlighter)�RichHandler)�Segment)�Style)�VERBOSE�	getLogger)�WINDOWS)�DEPRECATION_MSG_PREFIX)�
ensure_dirzpip.subprocessorc@seZdZdZdS)�BrokenStdoutLoggingErrorzO
    Raised if BrokenPipeError occurs for the stdout stream while logging.
    N)�__name__�
__module__�__qualname__�__doc__�rr�F/usr/local/lib/python3.10/dist-packages/pip/_internal/utils/logging.pyr(sr�	exc_class�type[BaseException]�exc�
BaseException�return�boolcCs0|turdSts
dSt|t�o|jtjtjfvS)NTF)�BrokenPipeErrorr�
isinstance�OSError�errno�EINVAL�EPIPE)rr!rrr�_is_broken_pipe_error.s
r+��num�int�Generator[None, None, None]c	csD�t�t_tj|7_z
dVWtj|8_dStj|8_w)zv
    A context manager which will cause the log output to be indented for any
    log messages emitted inside it.
    N)�get_indentation�
_log_state�indentation)r-rrr�
indent_log;s�"r3cCsttdd�S)Nr2r)�getattrr1rrrrr0J�r0cs@eZdZdZdd�d�fdd�Zddd�Zd�fdd�Z�ZS)�IndentingFormatterz%Y-%m-%dT%H:%M:%SF)�
add_timestamp�argsrr7r$�kwargsr#�Nonecs||_t�j|i|��dS)z�
        A logging.Formatter that obeys the indent_log() context manager.

        :param add_timestamp: A bool indicating output lines should be prefixed
            with their record's timestamp.
        N)r7�super�__init__)�selfr7r8r9��	__class__rrr<QszIndentingFormatter.__init__�	formatted�str�levelnor.cCs.|tjkrdS|�t�rdS|tjkrdSdS)zv
        Return the start of the formatted log message (not counting the
        prefix to add to each line).
        �z	WARNING: zERROR: )�logging�WARNING�
startswithr�ERROR)r=r@rBrrr�get_message_start`s


z$IndentingFormatter.get_message_start�record�logging.LogRecordcslt��|�}|�||j�}||}d�|jr|�|��d���dt�7�d��fdd�|�d�D��}|S)z�
        Calls the standard formatter, but will indent all of the log message
        lines by our current indentation level.
        rC� csg|]}�|�qSrr)�.0�line��prefixrr�
<listcomp>}sz-IndentingFormatter.format.<locals>.<listcomp>T)	r;�formatrHrBr7�
formatTimer0�join�
splitlines)r=rIr@�
message_startr>rNrrQpszIndentingFormatter.format)r8rr7r$r9rr#r:)r@rArBr.r#rA)rIrJr#rA)rrr�default_time_formatr<rHrQ�
__classcell__rrr>rr6Ns�
r6c@s(eZdZUded<ded<ddd�Zd
S)�IndentedRenderabler�
renderabler.�indent�consoler	�optionsr
r#r
ccsL�|�|j|�}t�|�}|D]}td|j�V|EdHtd�VqdS)NrK�
)�renderrYr�split_linesrZ)r=r[r\�segments�linesrMrrr�__rich_console__�s�

�z#IndentedRenderable.__rich_console__N)r[r	r\r
r#r
)rrr�__annotations__rbrrrrrX�s
rXc@seZdZddd�ZdS)�
PipConsoler#r:cCst�d��N)r%�r=rrr�on_broken_pipe�szPipConsole.on_broken_pipeN)r#r:)rrrrgrrrrrd�srdF��stderrrir	cCs,|rtdus
Jd��tStdusJd��tS)Nzstderr rich console is missing!zstdout rich console is missing!)�_stderr_console�_stdout_consolerhrrr�get_console�s
rlcsDeZdZUgZded<d�fdd�Zddd�Zd�fd
d�Z�ZS)�RichPipStreamHandlerzClassVar[list[str] | None]�KEYWORDSr[r	r#r:cst�j|dddt�d�dS)NF)r[�	show_time�
show_level�	show_path�highlighter)r;r<r)r=r[r>rrr<�s
�zRichPipStreamHandler.__init__rIrJcCs�d}t|dd�r+t|jt�sJ�|j\}t|tttf�s#J|�d���t|t�d�}n'|�	|�}|�
||�}|jdurR|jtj
krGtdd�}n|jtjkrRtdd�}z
|jj|dd|d	�WdStyn|�|�YdSw)
N�richFz is not rich-console-renderable)rZ�red)�color�yellow�ignore)�overflow�crop�style)r4r&r8�tuplerrrArXr0rQ�render_messagerBrDrGrrEr[�print�	Exception�handleError)r=rIrz�rich_renderablerY�messagerrr�emit�s0
���


�zRichPipStreamHandler.emitcsFt��dd�\}}|r|r|jjtjurt||�rt��t��|�S)z1Called when logging is unable to log some output.Nr,)	�sys�exc_infor[�file�stdoutr+rr;r)r=rIrr!r>rrr�s���z RichPipStreamHandler.handleError)r[r	r#r:)rIrJr#r:)	rrrrnrcr<r�rrWrrr>rrm�s



rmcseZdZd�fdd�Z�ZS)�BetterRotatingFileHandlerr#rcsttj�|j��t���Sre)r�os�path�dirname�baseFilenamer;�_openrfr>rrr��s
zBetterRotatingFileHandler._open)r#r)rrrr�rWrrr>rr��sr�c@s eZdZd
dd�Zdd
d�ZdS)�MaxLevelFilter�levelr.r#r:cCs
||_dSre)r�)r=r�rrrr<�s
zMaxLevelFilter.__init__rIrJr$cCs|j|jkSre)rBr��r=rIrrr�filter�r5zMaxLevelFilter.filterN)r�r.r#r:�rIrJr#r$)rrrr<r�rrrrr��s
r�cs"eZdZdZd�fdd�Z�ZS)	�ExcludeLoggerFilterzQ
    A logging Filter that excludes records from a logger (or its children).
    rIrJr#r$cst��|�Sre)r;r�r�r>rrr��szExcludeLoggerFilter.filterr�)rrrrr�rWrrr>rr��sr��	verbosity�no_color�
user_log_file�
str | NonecCs�|dkrtj}n"|dkrt}n|dkrtj}n|dkrtj}n|dkr'tj}ntj}t�|�}|du}|r:|}d}nd}|}|d	vrDd
nd}ddd
�}	gd�|rSdgng}
tt	j
|dd�att	j|dd�}tj
�dddtjd�dtjd�dtjd�d�tdd�tddd�d�||	dtddgd d!�d
|	d|dgd d!�||	d|d"gd d!�d|	d#|d$dd%d&�d'�||
d(�d)d*|iid+��|S),znConfigures and sets up all of the logging

    Returns the requested logging level, as its integer value.
    r,����������N�DEBUGz	/dev/null)�INFOrGrEz0pip._internal.utils.logging.RichPipStreamHandlerz5pip._internal.utils.logging.BetterRotatingFileHandler)�streamr�)r[�console_errors�console_subprocess�user_logT)r�r��	soft_wrapFz*pip._internal.utils.logging.MaxLevelFilter)�()r�zlogging.Filter)r��namez/pip._internal.utils.logging.ExcludeLoggerFilter)�exclude_warnings�restrict_to_subprocess�exclude_subprocessz%(message)s)r�rQ)r�rQr7)rZ�indent_with_timestampr�r�r�rZ)r��classr[�filters�	formatterr�r�zutf-8r�)r�r��filename�encoding�delayr�)r[r�r�r�)r��handlerszpip._vendorr�)�version�disable_existing_loggersr��
formattersr��root�loggers)rDr�rrErG�CRITICALr��getLevelNamerdr�r�rkri�config�
dictConfig�subprocess_loggerr�r6)r�r�r��level_numberr��include_user_log�additional_log_file�
root_level�vendored_log_level�handler_classesr�rjrrr�
setup_logging�s�
���������
��
���"�
��Fr�)rr r!r"r#r$)r,)r-r.r#r/)r#r.)rir$r#r	)r�r.r�r$r�r�r#r.)B�
__future__r�
contextlibr(rD�logging.handlersr�r��	threading�collections.abcr�dataclassesr�iorr�typingrr�pip._vendor.rich.consoler	r
rrr
r�pip._vendor.rich.highlighterr�pip._vendor.rich.loggingr�pip._vendor.rich.segmentr�pip._vendor.rich.styler�pip._internal.utils._logrr�pip._internal.utils.compatr�pip._internal.utils.deprecationr�pip._internal.utils.miscr�localr1rkrjr�r~rr+�contextmanagerr3r0�	Formatterr6rXrdrlrmr��RotatingFileHandlerr�r�r�r�rrrr�<module>sR 


3	<