File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/utils/__pycache__/logging.cpython-310.pyc
Back
o ;jL/ � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl m Z d dlmZ d dl mZ d dlmZ d dlmZmZ d dlmZmZmZmZmZmZ d d lmZ d d lmZ d dlmZ d dl m!Z! d d l"m#Z#m$Z$ d dl%m&Z& d dl'm(Z( d dl)m*Z* e�+� Z,da-dZ.e$d�Z/G dd� de0�Z1d>dd�Z2ej3d?d@d d!��Z4dAd"d#�Z5G d$d%� d%ej6�Z7eG d&d'� d'��Z8G d(d)� d)e�Z9d*d+�dBd.d/�Z:G d0d1� d1e�Z;G d2d3� d3ej<j=�Z>G d4d5� d5e�Z?G d6d7� 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 @ s e Zd ZdZdS )�BrokenStdoutLoggingErrorzO Raised if BrokenPipeError occurs for the stdout stream while logging. N)�__name__� __module__�__qualname__�__doc__� r r �O/opt/saltstack/salt/lib/python3.10/site-packages/pip/_internal/utils/logging.pyr ( s r � exc_class�type[BaseException]�exc� BaseException�return�boolc C s0 | t u rdS ts dS t|t�o|jtjtjfv S )NTF)�BrokenPipeErrorr � isinstance�OSError�errno�EINVALZEPIPE)r r! r r r �_is_broken_pipe_error. s r* � �num�int�Generator[None, None, None]c c sD � t � t_t j| 7 _z dV W t j| 8 _dS t j| 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, r r r � indent_log; s �"r2 c C s t tdd�S )Nr1 r )�getattrr0 r r r r r/ J � r/ c s@ e Zd ZdZdd�d� fdd�Zddd�Zd� fdd�Z� ZS )�IndentingFormatterz%Y-%m-%dT%H:%M:%SF)� add_timestamp�argsr r6 r$ �kwargsr# �Nonec s || _ 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)r6 �super�__init__)�selfr6 r7 r8 �� __class__r r r; Q s zIndentingFormatter.__init__� formatted�str�levelnor- c C s. |t jk rdS |�t�rdS |t jk rdS dS )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<