HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3.9/site-packages/pip/_internal/utils/__pycache__/logging.cpython-39.pyc
a

g��e80�@s�ddlZddlZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZddlmZmZddlmZddlmZddlmZzddlZWney�ddlZYn0zddlmZWney�dZYn0e��Z ed	�Z!Gd
d�de�Z"e�rdd
�Z#ndd
�Z#ej$d"dd��Z%dd�Z&Gdd�dej'�Z(dd�Z)Gdd�dej*�Z+Gdd�dej,j-�Z.Gdd�de�Z/Gdd�de�Z0d d!�Z1dS)#�N)�Filter)�IO�Any�Callable�Iterator�Optional�TextIO�Type�cast)�VERBOSE�	getLogger)�WINDOWS)�DEPRECATION_MSG_PREFIX)�
ensure_dir)�coloramazpip.subprocessorc@seZdZdZdS)�BrokenStdoutLoggingErrorzO
    Raised if BrokenPipeError occurs for the stdout stream while logging.
    N)�__name__�
__module__�__qualname__�__doc__�rr�?/usr/lib/python3.9/site-packages/pip/_internal/utils/logging.pyr!srcCs$|tup"t|t�o"|jtjtjfvS)z(See the docstring for non-Windows below.)�BrokenPipeError�
isinstance�OSError�errno�EINVALZEPIPE��	exc_class�excrrr�_is_broken_pipe_error.s�r cCs|tuS)z�
        Return whether an exception is a broken pipe error.

        Args:
          exc_class: an exception class.
          exc: an exception instance.
        )rrrrrr 8s	�c	csDt�t_tj|7_zdVWtj|8_ntj|8_0dS)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)Znumrrr�
indent_logDs
r%cCsttdd�S)Nr$r)�getattrr#rrrrr"Tsr"cs:eZdZdZdd��fdd�
Zdd�Z�fdd	�Z�ZS)
�IndentingFormatterz%Y-%m-%dT%H:%M:%SF)�
add_timestampcs||_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)r(�super�__init__)�selfr(�args�kwargs��	__class__rrr*\s
zIndentingFormatter.__init__cCs.|tjkrdS|�t�rdS|tjkr*dSdS)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+�	formatted�levelnorrr�get_message_startls


z$IndentingFormatter.get_message_startcslt��|�}|�||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.
        r0� csg|]}�|�qSrr)�.0�line��prefixrr�
<listcomp>��z-IndentingFormatter.format.<locals>.<listcomp>T)	r)�formatr7r6r(Z
formatTimer"�join�
splitlines)r+�recordr5Z
message_startr.r;rr?}szIndentingFormatter.format)rrrZdefault_time_formatr*r7r?�
__classcell__rrr.rr'Ys
�r'cs�fdd�}|S)Ncsd�t��|tjjg�S)Nr0)r@�listrZStyleZ	RESET_ALL)�inp��colorsrr�wrapped�sz_color_wrap.<locals>.wrappedr)rGrHrrFr�_color_wrap�srIcsteZdZer2ejeejj�fej	eejj
�fgZngZd�fdd�	Zdd�Z
dd�Z�fdd	�Z�fd
d�Z�ZS)
�ColorizedStreamHandlerNcs,t��|�||_tr(tr(t�|j�|_dS�N)r)r*�	_no_colorr
r�AnsiToWin32�stream)r+rN�no_colorr.rrr*�szColorizedStreamHandler.__init__cCs.tr"tr"ttj|j�}|jtjuS|jtjuS)zA
        Return whether the handler is using sys.stdout.
        )r
rr
rMrNrH�sys�stdout)r+rNrrr�
_using_stdout�sz$ColorizedStreamHandler._using_stdoutcCsXtr
|jrdSt|jtj�s"|jn|jj}t|d�r@|��r@dStj	�
d�dkrTdSdS)NF�isattyTZTERMZANSI)rrLrrNrMrH�hasattrrS�os�environ�get)r+Zreal_streamrrr�should_color�s
��z#ColorizedStreamHandler.should_colorcs>t��|�}|��r:|jD]\}}|j|kr||�}q:q|SrK)r)r?rX�COLORSr6)r+rB�msg�levelZcolorr.rrr?�s
zColorizedStreamHandler.formatcs@t��dd�\}}|r4|r4|��r4t||�r4t��t��|�S)Nr!)rP�exc_inforRr rr)�handleError)r+rBrrr.rrr]�s����z"ColorizedStreamHandler.handleError)NN)rrrrr1r4rIZForeZREDr2ZYELLOWrYr*rRrXr?r]rCrrr.rrJ�s�
rJcseZdZ�fdd�Z�ZS)�BetterRotatingFileHandlercsttj�|j��t���SrK)rrU�path�dirnameZbaseFilenamer)�_open)r+r.rrra�szBetterRotatingFileHandler._open)rrrrarCrrr.rr^�sr^c@seZdZdd�Zdd�ZdS)�MaxLevelFiltercCs
||_dSrK)r[)r+r[rrrr*�szMaxLevelFilter.__init__cCs|j|jkSrK)r6r[�r+rBrrr�filter�szMaxLevelFilter.filterN)rrrr*rdrrrrrb�srbcs eZdZdZ�fdd�Z�ZS)�ExcludeLoggerFilterzQ
    A logging Filter that excludes records from a logger (or its children).
    cst��|�SrK)r)rdrcr.rrrdszExcludeLoggerFilter.filter)rrrrrdrCrrr.rre�srecCs~|dkrtj}nD|dkrt}n6|dkr.tj}n&|dkr>tj}n|dkrNtj}ntj}t�|�}|du}|rt|}d}nd}|}|d	vr�d
nd}ddd
�}	ddd�}
gd�|r�dgng}tj�	dddtjd�dt
jd�dt
jd�d�tdd�tddd�d�||
d||	d d!d"gd#d$�d
|
d||	d%d!gd#d$�||
d||	d%d&gd#d$�d|
d'|d(dd)d*�d+�||d,�d-d.|iid/��|S)0znConfigures and sets up all of the logging

    Returns the requested logging level, as its integer value.
    r!����������N�DEBUGz	/dev/null)�INFOr4r2zext://sys.stdoutzext://sys.stderr)rQ�stderrz2pip._internal.utils.logging.ColorizedStreamHandlerz5pip._internal.utils.logging.BetterRotatingFileHandler)rN�file)�console�console_errors�console_subprocess�user_logFz*pip._internal.utils.logging.MaxLevelFilter)�()r[zlogging.Filter)rr�namez/pip._internal.utils.logging.ExcludeLoggerFilter)�exclude_warnings�restrict_to_subprocess�exclude_subprocessz%(message)s)rrr?T)rrr?r()�indent�indent_with_timestamprNrQrvrtrw)r[�classrOrN�filters�	formatterrlrurmzutf-8rx)r[ry�filename�encodingZdelayr{)rnrorprq)r[�handlerszpip._vendorr[)�versionZdisable_existing_loggersrzZ
formattersr~�rootZloggers)
r1rjrr2r4ZCRITICALrkZgetLevelNameZconfigZ
dictConfig�subprocess_loggerrsr')�	verbosityrOZ
user_log_fileZlevel_numberr[Zinclude_user_logZadditional_log_fileZ
root_levelZvendored_log_levelZlog_streamsZhandler_classesr~rrr�
setup_loggings�
����������
�	��	��%�
��Ir�)r!)2�
contextlibrr1Zlogging.handlersrUrPr�typingrrrrrrr	r
Zpip._internal.utils._logrrZpip._internal.utils.compatr
Zpip._internal.utils.deprecationrZpip._internal.utils.miscr�	threading�ImportErrorZdummy_threadingZpip._vendorr�	Exception�localr#r�rr �contextmanagerr%r"Z	Formatterr'rIZ
StreamHandlerrJr~ZRotatingFileHandlerr^rbrer�rrrr�<module>sF(
	

6	V