PATH:
opt
/
alt
/
python39
/
lib
/
python3.9
/
site-packages
/
pip
/
_vendor
/
colorama
/
__pycache__
a ��Re) � @ s� d dl Z d dlZd dlZddlmZmZmZmZmZ ddl m Z mZmZ ddl mZmZ dZ edurje � Z G dd� de�ZG dd � d e�ZdS ) � N� )�AnsiFore�AnsiBack� AnsiStyle�Style�BEL)�WinTerm�WinColor�WinStyle)�windll�winapi_testc @ sL e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z e dd� �ZdS )� StreamWrapperz� Wraps a stream (such as stdout), acting as a transparent proxy for all attribute access apart from method 'write()', which is delegated to our Converter instance. c C s || _ || _d S �N)�_StreamWrapper__wrapped�_StreamWrapper__convertor)�self�wrapped� converter� r ��/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/colorama/ansitowin32.py�__init__ s zStreamWrapper.__init__c C s t | j|�S r )�getattrr )r �namer r r �__getattr__ s zStreamWrapper.__getattr__c O s | j j|i |��S r )r � __enter__�r �args�kwargsr r r r s zStreamWrapper.__enter__c O s | j j|i |��S r )r �__exit__r r r r r % s zStreamWrapper.__exit__c C s | j �|� d S r )r �write�r �textr r r r ( s zStreamWrapper.writec C sZ | j }dtjv r0|d ur0|tju s,|tju r0dS z |j}W n tyN Y dS 0 |� S d S )N�PYCHARM_HOSTEDTF)r �os�environ�sys� __stdout__� __stderr__�isatty�AttributeError)r �stream� stream_isattyr r r r( + s zStreamWrapper.isattyc C s( | j }z|jW S ty" Y dS 0 d S �NT)r �closedr) )r r* r r r r- 7 s zStreamWrapper.closedN)�__name__� __module__�__qualname__�__doc__r r r r r r( �propertyr- r r r r r s r c @ s~ e Zd ZdZe�d�Ze�d�Zddd�Zdd � Z d d� Z dd � Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� ZdS )�AnsiToWin32z� Implements a 'write()' method which, on Windows, will strip ANSI character sequences from the text, and if outputting to a tty, will convert them into win32 function calls. z?\[((?:\d|;)*)([a-zA-Z])?z?\]([^]*)()?NFc C s� || _ || _t|| �| _tjdk}|o*t� }|d u rN|pL| jj oL| j�� }|| _ |d u rt|or| jj or| j�� }|| _ | �� | _| j t ju | _d S )N�nt)r � autoresetr r* r# r r r- r( �strip�convert�get_win32_calls�win32_callsr% �stderr� on_stderr)r r r7 r6 r5 � on_windows�conversion_supportedr r r r I s zAnsiToWin32.__init__c C s | j p| jp| jS )aj True if this class is actually needed. If false, then the output stream will not be affected, nor will win32 calls be issued, so wrapping stdout is not actually required. This will generally be False on non-Windows platforms, unless optional functionality like autoreset has been requested using kwargs to init() )r7 r6 r5 �r r r r �should_wrapj s zAnsiToWin32.should_wrapc N C s@ | j �r:t�r:tjtjftjtjtjftjtjtj ftj tjtj ft jtjt jft jtjt jft jtjt jft jtjt jft jtjt jft jtjt jft jtjt jft jtjt jft jtjft jtjt jdft jtjt jdft jtjt jdft jtjt jdft jtjt jdft jtjt jdft jtjt jdft jtjt jdftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj t jftjtj ftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdftjtj t jdfi&S t!� S r, )"r7 �wintermr � RESET_ALL� reset_all�BRIGHT�styler �DIM�NORMALr �BLACK�forer �RED�GREEN�YELLOW�BLUE�MAGENTA�CYAN�WHITE�GREY�RESET� LIGHTBLACK_EX�LIGHTRED_EX� LIGHTGREEN_EX�LIGHTYELLOW_EX�LIGHTBLUE_EX�LIGHTMAGENTA_EX�LIGHTCYAN_EX� LIGHTWHITE_EXr �back�dictr>