← back to Atmos Game

assets/gen/.venv/lib/python3.12/site-packages/click/__pycache__/_compat.cpython-312.pyc

102 lines

�

c�bj�I����UddlmZddlZddlmZddlZddlZddlZddl	Z	ddl
Zddlm
Z
ddlmZe	j j#d�Ze	j j#d�ZdZded<ej,d	�Z		d;											d<d
�Zd=d�Zd>d�ZGd
�dej6�ZGd�d�Zd?d@d�Zd?d@d�ZdAd�Z dAd�Z!dBd�Z"dCd�Z#								dDd�Z$		d;															dEd�Z%	d?									dFd�Z&	d?									dGd�Z'dHd�Z(dHd�Z)dHd�Z*dIdJd�Z+dIdJd�Z,dIdJd �Z-										dKd!�Z.				dL											dMd"�Z/Gd#�d$�Z0dNd%�Z1dOd&�Z2	dI					dPd'�Z3e	j j#d�rerd(d)l4m5Z5dQd*�Z6e�Z7d+ed,<dRdSd-�ZndQd.�Z6								dTd/�Z5dUd0�Z8dOd1�Z9						dVd2�Z:e:d3�e+�Z;e:d4�e,�Z<e:d5�e-�Z=e(e)e*d6�Z>d7ed8<e+e,e-d6�Z?d9ed:<y)W�)�annotationsN)�
TracebackType��WeakKeyDictionary�cygwin�winz't.Callable[[t.TextIO], t.TextIO] | None�auto_wrap_for_ansiz\033\[[;?0-9]*[a-zA-Z]c�F�|�t|�}|�d}t|||d||��S)N�replaceT)�line_buffering�force_readable�force_writable)�get_best_encoding�_NonClosingTextIOWrapper)�stream�encoding�errorsr
rs     �d/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/click/_compat.py�_make_text_streamrs=����$�V�,��
�~���#�����%�%�
��c�f�	tj|�jdk(S#t$rYywxYw)z$Checks if a given encoding is ascii.�asciiF)�codecs�lookup�name�LookupError)rs r�is_ascii_encodingr(s3����}�}�X�&�+�+�w�6�6������s�!$�	0�0c�d�t|dd�xstj�}t|�ry|S)z1Returns the default stream encoding if not found.rNzutf-8)�getattr�sys�getdefaultencodingr)r�rvs  rrr0s.��	���T�	*�	F�c�.D�.D�.F�B�����
�Irc�P��eZdZ		d													d�fd�
Zdd�Zdd�Z�xZS)rc���tjtjt|||��x|_}t�|�|||fi|��y�N)�t�cast�BinaryIO�_FixupStream�_stream�super�__init__)�selfrrrr
r�extra�	__class__s       �rr,z!_NonClosingTextIOWrapper.__init__9sF���!"���
�J�J��V�^�^�L�!
�	
���v�	�����6�;�U�;rc�D�	|j�y#t$rYywxYwr%)�detach�	Exception�r-s r�__del__z _NonClosingTextIOWrapper.__del__Gs"��	��K�K�M���	��	�s��	�c�6�|jj�Sr%)r*�isattyr3s rr6z_NonClosingTextIOWrapper.isattyMs���|�|�"�"�$�$r�FF)r�
t.BinaryIOr�
str | Nonerr9r
�boolrr:r.�t.Any�return�None)r<r=�r<r:)�__name__�
__module__�__qualname__r,r4r6�
__classcell__)r/s@rrr8s^��� %�$�
<��<��<��	<�
�<��
<��<�
�<��%rrc�P�eZdZdZ		d						d
d�Zdd�Zdd�Zd
d�Zd
d�Zd
d�Z	y)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).
    c�.�||_||_||_yr%)r*�_force_readable�_force_writable)r-rr
rs    rr,z_FixupStream.__init__\s�����-���-��rc�.�t|j|�Sr%)rr*�r-rs  r�__getattr__z_FixupStream.__getattr__fs���t�|�|�T�*�*rc��t|jdd�}|� tjt||��S|jj|�S)N�read1)rr*r&r'�bytes�read)r-�size�fs   rrKz_FixupStream.read1isC���D�L�L�'�4�0���=��6�6�%��4��)�)��|�|� � ��&�&rc���|jryt|jdd�}|�tjt
|��S	|jj
d�y#t$rYywxYw)NT�readablerF)rErr*r&r'r:rMr2�r-�xs  rrQz_FixupStream.readableqsh�������D�L�L�*�d�3���=��6�6�$���$�$�	��L�L���a� ����	��	�s�A#�#	A/�.A/c�<�|jryt|jdd�}|�tjt
|��S	|jj
d�y#t$r/	|jj
d�Yy#t$rYYywxYwwxYw)NT�writablerF)rFrr*r&r'r:�writer2rRs  rrUz_FixupStream.writable}s��������D�L�L�*�d�3���=��6�6�$���$�$�	��L�L���s�#����	�
����"�"�3�'����
��
��	�s*�A#�#	B�-B
�
	B�B�B�Bc���t|jdd�}|�tjt|��S	|jj|jj
��y#t$rYywxYw)N�seekableFT)rr*r&r'r:�seek�tellr2rRs  rrXz_FixupStream.seekable�si���D�L�L�*�d�3���=��6�6�$���$�$�	��L�L���d�l�l�/�/�1�2����	��	�s�3A.�.	A:�9A:Nr7)rr8r
r:rr:�r�strr<r;)rN�intr<rLr>)
r?r@rA�__doc__r,rIrKrQrUrX�rrr)r)RsI��� %�$�	.��.��.��	.�+�'�
�
�rr)c�d�	t|jd�t�S#t$r|cYSwxYw�Nr)�
isinstancerMrLr2�r�defaults  r�_is_binary_readerre�s0����&�+�+�a�.�%�0�0�������s�!�/�/c��	|jd�y#t$r(	|jd�Yy#t$rYnwxYw|cYSwxYw)Nr�FT)rVr2rcs  r�_is_binary_writerrh�sT������S������	��L�L������	��	����
�s%��	A�1�	=�A�=�A�Ac���t|d�r$tjtj|�St	|dd�}|�0t|d�r$tjtj|�Sy�NF�bufferT)rer&r'r(r�r�bufs  r�_find_binary_readerrn��Z��
���'��v�v�a�j�j�&�)�)�
�&�(�D�
)�C���,�S�$�7��v�v�a�j�j�#�&�&�rc���t|d�r$tjtj|�St	|dd�}|�0t|d�r$tjtj|�Syrj)rhr&r'r(rrls  r�_find_binary_writerrq�rorc�6�tt|dd�xsd�S)z3A stream is misconfigured if its encoding is ASCII.rNr)rr�rs r�_stream_is_misconfiguredrt�s���W�V�Z��>�I�'�J�Jrc�>�t||d�}||k(xs
|duxr|duS)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)r�attr�value�stream_values    r�_is_compat_stream_attrry�s0��
�6�4��.�L��5� �P�U�d�]�%O�|�4�7O�Prc�:�t|d|�xr
t|d|�S)zcCheck if a stream's encoding and errors attributes are
    compatible with the desired values.
    rr)ry)rrrs   r�_is_compatible_text_streamr{�s)��"��
�H��;�
 ���6�
:�;rc�"�||d�r%tjtj|�}nNtjtj|�}t	|||�r|�t|�s|S||�}|�|S|}|�d}t
|||||��S)NFr)r
r)r&r'r(�TextIOr{rtr)	�text_streamrr�	is_binary�find_binaryr
r�
binary_reader�possible_binary_readers	         r�_force_correct_text_streamr��s�����e�$����q�z�z�;�7�
��f�f�Q�X�X�{�3��&�k�8�V�D���!9�+�!F���"-�[�!9��"�)���.�
��~�������%�%��rc�4�t|||tt|��S)N�r
)r�rern)�text_readerrrr
s    r�_force_correct_text_readerr��#��&������%�
�rc�4�t|||tt|��S)N�r)r�rhrq)�text_writerrrrs    r�_force_correct_text_writerr�,r�rc�R�ttj�}|�td��|S)Nz6Was not able to determine binary stream for sys.stdin.)rnr �stdin�RuntimeError)�readers r�get_binary_stdinr�<s&��
 ����
+�F�
�~��S�T�T��Mrc�R�ttj�}|�td��|S)Nz7Was not able to determine binary stream for sys.stdout.)rqr �stdoutr���writers r�get_binary_stdoutr�C�&��
 ����
,�F�
�~��T�U�U��Mrc�R�ttj�}|�td��|S)Nz7Was not able to determine binary stream for sys.stderr.)rqr �stderrr�r�s r�get_binary_stderrr�Jr�rc�z�ttj||�}|�|Sttj||d��S)NTr�)�_get_windows_console_streamr r�r��rrr"s   r�get_text_stdinr�Qs4��	$�S�Y�Y��&�	A�B�	�~��	�%�c�i�i��6�RV�W�Wrc�z�ttj||�}|�|Sttj||d��S�NTr�)r�r r�r�r�s   r�get_text_stdoutr�X�4��	$�S�Z�Z��6�	B�B�	�~��	�%�c�j�j�(�F�SW�X�Xrc�z�ttj||�}|�|Sttj||d��Sr�)r�r r�r�r�s   r�get_text_stderrr�_r�rc�@�d|vrt||�St||||��S)z?Handles not passing ``encoding`` and ``errors`` in binary mode.�b�rr)�open)�file�moderrs    r�
_wrap_io_openr�fs)���d�{��D�$�����d�X�f�=�=rc����d�v}tj|�}tj|�dk(rNt�fd�dD��r|rt	�dfSt||��dfS|rt
�dfSt||��dfS|st|�||�dfSd�vrtd	��d
�vrtd��d�vrtd
��ddl
}ddl}	tj|�j}tjtj ztj"z}	|r|	t%tdd�z}		tj&j)tj&j+|�d|j-d�d���}
	tj.|
|	|�dn|�}	|�tj>|
|�t|�||�}
tA|
|
tj&jC|��}tEjFtDjHtDjJ|�dfS#t$rd}Y��KwxYw#t$r�}|j|j0k(s�tj2dk(rv|j|j4k(r]tj&j7|j8�r4tj:|j8tj<�rYd}~����d}~wwxYw)Nr��-c3�&�K�|]}|�v���
y�wr%r_)�.0�mr�s  �r�	<genexpr>zopen_stream.<locals>.<genexpr>�s�����2�/�Q�q�D�y�/�s�)�w�arSFr�Tr�z�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.rSz&Use the `overwrite`-parameter instead.r�z,Atomic writes only make sense with `w`-mode.r�O_BINARYz.__atomic-writel�08xi��nt)&�os�fspath�fsdecode�anyr�r�r�r�r��
ValueError�errno�random�stat�st_mode�OSError�O_RDWR�O_CREAT�O_EXCLr�path�join�dirname�	randranger��EEXISTr�EACCES�isdir�filename�access�W_OK�chmod�_AtomicFile�realpathr&r'�IO�Any)r�r�rr�atomic�binaryr�r��perm�flags�tmp_filename�fd�erO�afs `             r�open_streamr�ssy����D�[�F��y�y��"�H�
�{�{�8���#��2�/�2�2��(�*�E�1�1�"�H�V�D�e�K�K��#�%�u�,�,��x��?��F�F���X�t�X�v�>��D�D��d�{��
,�
�	
��d�{��A�B�B�
�$���G�H�H�����7�7�8�,�4�4��
�I�I��
�
�"�R�Y�Y�.�E�
�
���Z��+�+��
��w�w�|�|��G�G�O�O�H�%��f�.�.�w�7��<�=�
��	�����u�t�|�e��N�B����
����t�$��b�$��&�1�A�	�Q��b�g�g�&6�&6�x�&@�	A�B��6�6�!�$�$�q�u�u�+�r�"�D�(�(��?������ �	��w�w�%�,�,�&����4���G�G�u�|�|�+��G�G�M�M�!�*�*�-��I�I�a�j�j�"�'�'�2����	�s1�	H%�H7�%H4�3H4�7	K(�BK#�"K#�#K(c�`�eZdZd	d�Zed
d��Zddd�Zd
d�Zdd�Z								dd�Z	d
d�Z
y)r�c�<�||_||_||_d|_y�NF)�_f�
_tmp_filename�_real_filename�closed)r-rOr��
real_filenames    rr,z_AtomicFile.__init__�s �����)���+�����rc��|jSr%)r�r3s rrz_AtomicFile.name�s���"�"�"rc��|jry|jj�tj|j
|j�d|_y)NT)r�r��closer�rr�r�)r-�deletes  rr�z_AtomicFile.close�s:���;�;�����
�
��
�
�
�4�%�%�t�':�':�;���rc�.�t|j|�Sr%)rr�rHs  rrIz_AtomicFile.__getattr__�s���t�w�w��%�%rc��|Sr%r_r3s r�	__enter__z_AtomicFile.__enter__�s���rc�,�|j|du��y)N)r�)r�)r-�exc_type�	exc_value�tbs    r�__exit__z_AtomicFile.__exit__�s��	
�
�
�(�$�.�
�/rc�,�t|j�Sr%)�reprr�r3s r�__repr__z_AtomicFile.__repr__�s���D�G�G�}�rN)rO�t.IO[t.Any]r�r\r�r\r<r=�r<r\�F)r�r:r<r=r[)r<r�)r�ztype[BaseException] | Noner�zBaseException | Noner�zTracebackType | Noner<r=)r?r@rAr,�propertyrr�rIr�r�r�r_rrr�r��sZ����#��#��&��0�,�0�(�0�
!�	0�

�0�rr�c�.�tjd|�S)Nrg)�_ansi_re�sub)rws r�
strip_ansir��s���<�<��E�"�"rc��t|ttf�r#|j}t|ttf�r�#|jj
j
d�S)Nz
ipykernel.)rbr)rr*r/r@�
startswithrss r�_is_jupyter_kernel_outputr��sL��
�V�l�,D�E�
F������V�l�,D�E�
F����&�&�1�1�,�?�?rc��|�:|�tj}n
t|d�ryt|�xrt	|�S|S)N�colorF)r r��hasattrr6r�)rr�s  r�should_strip_ansir�sI��
�}��>��Y�Y�F�
�V�W�
%���&�>�!�K�*C�F�*K�&K�K��9�r�)r�c�*�ddl}|j�Sra)�locale�getpreferredencoding)rs r�_get_argv_encodingrs����*�*�,�,rz'cabc.MutableMapping[t.TextIO, t.TextIO]�_ansi_stream_wrappersc�j���	tj|�}|�|Sddl}t	||�}|j||���t
jtj�j�}|j�d��fd�}||_
	|t|<|S#t$rd}Y��wxYw#t$rY|SwxYw)zbSupport ANSI color and style codes on Windows by wrapping a
        stream with colorama.
        Nr)�stripc�R��	�|�S#t$r�j��wxYwr%)�
BaseException�	reset_all)�s�_write�ansi_wrappers ��r�_safe_writez'auto_wrap_for_ansi.<locals>._safe_write!s0���
��a�y� �� �
��&�&�(��
�s��&)r
r\r<r])r�getr2�coloramar�AnsiToWin32r&r'r}rrV)	rr��cachedrr	r"rrrs	       @@rr	r	s����	�*�.�.�v�6�F����M��!�&�%�0���+�+�F�%�+�@��
�V�V�A�H�H�l�1�1�
2������	����	�,.�!�&�)��	��7�	��F�	��0�	���	�	�s#�B�		B%�B"�!B"�%	B2�1B2c�d�ttjdd�xstj�S)Nr)rr r��getfilesystemencodingr_rrrr3s#���s�y�y�*�d�3�R�s�7P�7P�7R�Rrc��yr%r_)rOrrs   rr�r�6s��rc�*�tt|��Sr%)�lenr�)rSs r�term_lenr<s���z�!�}��rc�B�	|j�S#t$rYywxYwr�)r6r2rss rr6r6@s%����}�}��������s��	�c�0����t��d���fd�}|S)Nc�����}|�y	�j|�}|�|S��}	|�|<|S#t$rd}Y� wxYw#t$rY|SwxYwr%)rr2)rr"�cache�src_func�wrapper_funcs  ���r�funcz&_make_cached_stream_func.<locals>.funcMs{�������>��	����6�"�B��>��I�
�^��	��E�&�M��	���	��B�	���	���	�	�s�1�A�?�?�	A�A)r<�t.TextIO | Noner)rr r!rs`` @r�_make_cached_stream_funcr#Gs���6G�5H�E��&�Krc�"�tjSr%)r r�r_rr�<lambda>r%cs��s�y�yrc�"�tjSr%)r r�r_rrr%r%d����
�
rc�"�tjSr%)r r�r_rrr%r%er'r)r�r�r�z-cabc.Mapping[str, t.Callable[[], t.BinaryIO]]�binary_streamszAcabc.Mapping[str, t.Callable[[str | None, str | None], t.TextIO]]�text_streamsr7)rr8rr9rr9r
r:rr:r<�t.TextIO)rr\r<r:)rr�r<r\r�)rr�rdr:r<r:)rr�r<zt.BinaryIO | None)rr+r<r:)rr+rvr\rwr9r<r:)rr+rr9rr9r<r:)r~r�rr9rr9rz%t.Callable[[t.IO[t.Any], bool], bool]r�z,t.Callable[[t.IO[t.Any]], t.BinaryIO | None]r
r:rr:r<r+)
r�r�rr9rr9r
r:r<r+)
r�r�rr9rr9rr:r<r+)r<r8)NN)rr9rr9r<r+)
r�zstr | os.PathLike[str] | intr�r\rr9rr9r<r�)�rN�strictF)r�zstr | os.PathLike[str]r�r\rr9rr9r�r:r<ztuple[t.IO[t.Any], bool])rwr\r<r\)rr�r<r:)rzt.IO[t.Any] | Noner��bool | Noner<r:r�r%)rr+r�r.r<r+)rOr+rr9rr9r<r")rSr\r<r])r�t.Callable[[], t.TextIO | None]r zt.Callable[[], t.TextIO]r<r/)@�
__future__rr�collections.abc�abc�cabc�ior��rer �typingr&�typesr�weakrefr�platformr��CYGWIN�WINr	�__annotations__�compiler�rrr�
TextIOWrapperrr)rerhrnrqrtryr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�_winconsoler�rrrr6r#�_default_text_stdin�_default_text_stdout�_default_text_stderrr)r*r_rr�<module>rCs���"�
��	�	�	�
���%�	���	 �	 ��	*��	�l�l���e�$��>B��;�B��2�:�:�/�0��!� ������
���	�
���
�*��%�r�/�/�%�4B�B�J�
��$�$K�Q�;��;� *�;�4>�;�	�;�"!� �+��+��+�
�+�5�	+�
>�+��
+��+��+�d!�	
��
��
�
�
��	
�
�
�(!�	
��
��
�
�
��	
�
�
� ���X�Y�Y�
>�
&�
>�

�
>��
>�
�	
>�
�
>���!��N)�$�N)�

�N)��N)�
�	N)�

�N)��
N)�b!�!�H#�@�=A����.9��	��"�<�<���5�!�c�8�-�
FW�EX��B�X�!�JS����)��3=��	�����-��*��%��8/�/@�.�Q��/�0B�O�T��/�0B�O�T�����A��=�����S��O�r