HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/click/__pycache__/_compat.cpython-37.pyc
B

�P�e8I�
@s~UddlZddlZddlZddlZddlZddlZddlmZej	�
d�Zej	�
d�ZdZ
ejejejgejfed<e�d�Zdjejejeejeeeejd�d	d
�Zeed�dd
�Zejejed�dd�ZGdd�dej�ZGdd�d�Zdkejejeed�dd�Zdlejejeed�dd�Z ejejejejd�dd�Z!ejejejejd�dd�Z"ejed�dd�Z#ejeejeed �d!d"�Z$ejejeejeed#�d$d%�Z%dmejejejeejeejejejegefejejejgejejfeeejd&�d'd(�Z&dnejejejeejeeejd)�d*d+�Z'doejejejeejeeejd,�d-d.�Z(ejd/�d0d1�Z)ejd/�d2d3�Z*ejd/�d4d5�Z+dpejeejeejd6�d7d8�Z,dqejeejeejd6�d9d:�Z-drejeejeejd6�d;d<�Z.ej/ed=e0feejeejeejejd>�d?d@�Z1dsdCeejeejeeej2ejejefdD�dEdF�Z3GdGdH�dH�Z4eedI�dJdK�Z5ejejed�dLdM�Z6dtejejejejeedN�dOdP�Z7ej	�
d��rJe�rJdQdRl8m9Z9ed/�dSdT�Z:e�Z;ej<ejejfedU<duejejeejdN�dVd�Z
n8ed/�dWdT�Z:ejejeejeejejdX�dYdZ�Z9ee0d[�d\d]�Z=ejejed�d^d_�Z>ejgejejfejgejfejgejejfd`�dadb�Z?e?dcdd�e,�Z@e?dedd�e-�ZAe?dfdd�e.�ZBe)e*e+dg�ZCejDeejgejffedh<e,e-e.dg�ZEejDeejejeejegejffedi<dS)v�N)�WeakKeyDictionary�cygwin�win�auto_wrap_for_ansiz\033\[[;?0-9]*[a-zA-Z]F)�stream�encoding�errors�force_readable�force_writable�returncCs0|dkrt|�}|dkrd}t|||d||d�S)N�replaceT)�line_bufferingr	r
)�get_best_encoding�_NonClosingTextIOWrapper)rrrr	r
�r�>/opt/alt/python37/lib/python3.7/site-packages/click/_compat.py�_make_text_streamsr)rrcCs*yt�|�jdkStk
r$dSXdS)z$Checks if a given encoding is ascii.�asciiFN)�codecs�lookup�name�LookupError)rrrr�is_ascii_encoding$sr)rrcCs$t|dd�pt��}t|�r dS|S)z1Returns the default stream encoding if not found.rNzutf-8)�getattr�sys�getdefaultencodingr)r�rvrrrr,src	s\eZdZdejejeejeeeejdd��fdd�
Z	dd�dd�Z
ed�d	d
�Z�ZS)rFN)rrrr	r
�extrarcs4t�tjt|||��|_}t�j|||f|�dS)N)�t�cast�BinaryIO�_FixupStream�_stream�super�__init__)�selfrrrr	r
r)�	__class__rrr$5s	z!_NonClosingTextIOWrapper.__init__)rcCs&y|��Wntk
r YnXdS)N)�detach�	Exception)r%rrr�__del__Csz _NonClosingTextIOWrapper.__del__cCs
|j��S)N)r"�isatty)r%rrrr*Isz_NonClosingTextIOWrapper.isatty)FF)
�__name__�
__module__�__qualname__rr �Optional�str�bool�Anyr$r)r*�
__classcell__rr)r&rr4src@sreZdZdZdejeed�dd�Zeej	d�dd�Z
eed	�d
d�Z
ed�d
d�Zed�dd�Zed�dd�ZdS)r!aQThe new io interface needs more from streams than streams
    traditionally implement.  As such, this fix-up code is necessary in
    some circumstances.

    The forcing of readable and writable flags are there because some tools
    put badly patched objects on sys (one such offender are certain version
    of jupyter notebook).
    F)rr	r
cCs||_||_||_dS)N)r"�_force_readable�_force_writable)r%rr	r
rrrr$Xsz_FixupStream.__init__)rrcCst|j|�S)N)rr")r%rrrr�__getattr__bsz_FixupStream.__getattr__)�sizercCs2t|jdd�}|dk	r&t�t||��S|j�|�S)N�read1)rr"rr�bytes�read)r%r6�frrrr7esz_FixupStream.read1)rcCsX|jr
dSt|jdd�}|dk	r.t�t|��Sy|j�d�Wntk
rRdSXdS)NT�readablerF)r3rr"rrr0r9r()r%�xrrrr;msz_FixupStream.readablecCs~|jr
dSt|jdd�}|dk	r.t�t|��Sy|j�d�Wn:tk
rxy|j�d�Wntk
rrdSXYnXdS)NT�writable��F)r4rr"rrr0�writer()r%r<rrrr=ysz_FixupStream.writablecCsTt|jdd�}|dk	r$t�t|��Sy|j�|j���Wntk
rNdSXdS)N�seekableFT)rr"rrr0�seek�tellr()r%r<rrrrA�sz_FixupStream.seekableN)FF)r+r,r-�__doc__rr r0r$r/r1r5�intr8r7r;r=rArrrrr!Nsr!)r�defaultrcCs*yt|�d�t�Stk
r$|SXdS)Nr)�
isinstancer9r8r()rrFrrr�_is_binary_reader�srHcCsLy|�d�Wn8tk
rFy|�d�dStk
r@YnX|SXdS)Nr?r>FT)r@r()rrFrrr�_is_binary_writer�s
rIcCsHt|d�rt�tj|�St|dd�}|dk	rDt|d�rDt�tj|�SdS)NF�bufferT)rHrrr r)r�bufrrr�_find_binary_reader�s
rLcCsHt|d�rt�tj|�St|dd�}|dk	rDt|d�rDt�tj|�SdS)NFrJT)rIrrr r)rrKrrr�_find_binary_writer�s
rMcCstt|dd�pd�S)z3A stream is misconfigured if its encoding is ASCII.rNr)rr)rrrr�_stream_is_misconfigured�srN)r�attr�valuercCs$t||d�}||kp"|dko"|dk	S)z�A stream attribute is compatible if it is equal to the
    desired value or the desired value is unset and the attribute
    has a value.
    N)r)rrOrPZstream_valuerrr�_is_compat_stream_attr�srQ)rrrrcCst|d|�ot|d|�S)zcCheck if a stream's encoding and errors attributes are
    compatible with the desired values.
    rr)rQ)rrrrrr�_is_compatible_text_stream�s
rR)�text_streamrr�	is_binary�find_binaryr	r
rc	Cs~||d�rt�tj|�}nFt�tj|�}t|||�rH|dkrDt|�sH|S||�}|dkr\|S|}|dkrld}t|||||d�S)NFr)r	r
)rrr �TextIOrRrNr)	rSrrrTrUr	r
Z
binary_readerZpossible_binary_readerrrr�_force_correct_text_stream�s$	
rW)�text_readerrrr	rcCst|||tt|d�S)N)r	)rWrHrL)rXrrr	rrr�_force_correct_text_readersrY)�text_writerrrr
rcCst|||tt|d�S)N)r
)rWrIrM)rZrrr
rrr�_force_correct_text_writer(sr[)rcCsttj�}|dkrtd��|S)Nz6Was not able to determine binary stream for sys.stdin.)rLr�stdin�RuntimeError)�readerrrr�get_binary_stdin8s
r_cCsttj�}|dkrtd��|S)Nz7Was not able to determine binary stream for sys.stdout.)rMr�stdoutr])�writerrrr�get_binary_stdout?s
rbcCsttj�}|dkrtd��|S)Nz7Was not able to determine binary stream for sys.stderr.)rMr�stderrr])rarrr�get_binary_stderrFs
rd)rrrcCs,ttj||�}|dk	r|Sttj||dd�S)NT)r	)�_get_windows_console_streamrr\rY)rrrrrr�get_text_stdinMsrfcCs,ttj||�}|dk	r|Sttj||dd�S)NT)r
)rerr`r[)rrrrrr�get_text_stdoutVsrgcCs,ttj||�}|dk	r|Sttj||dd�S)NT)r
)rerrcr[)rrrrrr�get_text_stderr_srhzos.PathLike[str])�file�moderrrcCs"d|krt||�St||||d�S)z?Handles not passing ``encoding`` and ``errors`` in binary mode.�b)rr)�open)rirjrrrrr�
_wrap_io_openhs
rm�r�strictzt.Union[str, os.PathLike[str]])�filenamerjrr�atomicrc
s.d�k}t�|�}t�|�dkrrt�fdd�dD��rT|rDt�dfSt||d�dfS|rbt�dfSt||d�dfS|s�t|�||�dfSd	�kr�t	d
��d�kr�t	d��d
�kr�t	d��ddl
}ddl}yt�|�j
}Wntk
r�d}YnXtjtjBtjB}	|�r|	ttdd�O}	x�tj�tj�|�d|�d�d���}
y"t�|
|	|dk�rXdn|�}PWnttk
�r�}zT|j
|jk�s�tjdk�r�|j
|jk�r�tj�|j��r�t�|jtj��rĐw�Wdd}~XYnX�qW|dk	�r�t�|
|�t|�||�}
t |
|
tj�!|��}t"�#t"j$t"j%|�dfS)Nrk�-c3s|]}|�kVqdS)Nr)�.0�m)rjrr�	<genexpr>�szopen_stream.<locals>.<genexpr>)�w�ar<F)rrTrwz�Appending to an existing file is not supported, because that would involve an expensive `copy`-operation to a temporary file. Open the file in normal `w`-mode and copy explicitly if that's what you're after.r<z&Use the `overwrite`-parameter instead.rvz,Atomic writes only make sense with `w`-mode.r�O_BINARYz.__atomic-writel�08xi��nt)&�os�fspath�fsdecode�anyrbrgr_rfrm�
ValueError�errno�random�stat�st_mode�OSError�O_RDWR�O_CREAT�O_EXCLr�path�join�dirname�	randrangerl�EEXISTr�EACCES�isdirrp�access�W_OK�chmod�_AtomicFile�realpathrr�IOr1)rprjrrrq�binaryr�r�Zperm�flags�tmp_filename�fd�er:�afr)rjr�open_streamus`





r�c@s�eZdZejejeedd�dd�Zeed�dd��Z	de
dd	�d
d�Zeejd�d
d�Zdd�dd�Z
ejejeejdd�dd�Zed�dd�ZdS)r�N)r:r��
real_filenamercCs||_||_||_d|_dS)NF)�_f�
_tmp_filename�_real_filename�closed)r%r:r�r�rrrr$�sz_AtomicFile.__init__)rcCs|jS)N)r�)r%rrrr�sz_AtomicFile.nameF)�deletercCs.|jr
dS|j��t�|j|j�d|_dS)NT)r�r��closer{rr�r�)r%r�rrrr��s

z_AtomicFile.close)rrcCst|j|�S)N)rr�)r%rrrrr5�sz_AtomicFile.__getattr__cCs|S)Nr)r%rrr�	__enter__�sz_AtomicFile.__enter__)�exc_type�_rcGs|j|dk	d�dS)N)r�)r�)r%r�r�rrr�__exit__�sz_AtomicFile.__exit__cCs
t|j�S)N)�reprr�)r%rrr�__repr__�sz_AtomicFile.__repr__)F)r+r,r-rr�r1r/r$�propertyrr0r�r5r�r.�Type�
BaseExceptionr�r�rrrrr��s r�)rPrcCst�d|�S)Nr>)�_ansi_re�sub)rPrrr�
strip_ansi�sr�cCs(xt|ttf�r|j}qW|jj�d�S)Nz
ipykernel.)rGr!rr"r&r,�
startswith)rrrr�_is_jupyter_kernel_output�s
r�)r�colorrcCs0|dkr*|dkrtj}t|�o(t|�S|S)N)rr\r*r�)rr�rrr�should_strip_ansi�s
r��)recCsddl}|��S)Nr)�locale�getpreferredencoding)r�rrr�_get_argv_encodingsr��_ansi_stream_wrapperscs�yt�|�}Wntk
r&d}YnX|dk	r4|Sddl}t||�}|j||d��t�tj�j	�}|j
���fdd�}||_
y|t|<Wntk
r�YnX|S)zbSupport ANSI color and style codes on Windows by wrapping a
        stream with colorama.
        Nr)�stripcs,y�|�Stk
r&����YnXdS)N)r�Z	reset_all)�s)�_write�ansi_wrapperrr�_safe_writes
z'auto_wrap_for_ansi.<locals>._safe_write)r��getr(�coloramar�ZAnsiToWin32rrrVrr@)rr��cachedr�r�rr�r)r�r�rrs$

cCsttjdd�pt��S)Nr)rrr\�getfilesystemencodingrrrrr�.s)r:rrrcCsdS)Nr)r:rrrrrre1sre)r<rcCstt|��S)N)�lenr�)r<rrr�term_len7sr�cCs"y|��Stk
rdSXdS)NF)r*r()rrrrr*;sr*)�src_func�wrapper_funcrcs(t��tjtjd����fdd�}|S)N)rcsr��}|dkrdSy��|�}Wntk
r8d}YnX|dk	rF|S��}y|�|<Wntk
rlYnX|S)N)r�r()rr)�cacher�r�rr�funcHs
z&_make_cached_stream_func.<locals>.func)rrr.rV)r�r�r�r)r�r�r�r�_make_cached_stream_funcBsr�cCstjS)N)rr\rrrr�<lambda>^r?r�cCstjS)N)rr`rrrrr�_r?cCstjS)N)rrcrrrrr�`r?)r\r`rc�binary_streams�text_streams)FF)F)F)FF)F)F)NN)NN)NN)rnNroF)NN)N)Fr�ior{�rer�typingr�weakrefr�platformr�ZCYGWINZWINrr.�CallablerV�__annotations__�compiler�r r/r0rrr�r1r�
TextIOWrapperrr!rHrIrLrMrNrQrRrWrYr[r_rbrdrfrgrh�UnionrErm�Tupler�r�r�r�r�Z_winconsolerer�r��MutableMappingr�r*r�Z_default_text_stdinZ_default_text_stdoutZ_default_text_stderrr��Mappingr�rrrr�<module>s�"
E	
  	
V*
 K% &