HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/setuptools/_vendor/jaraco/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/setuptools/_vendor/jaraco/__pycache__/context.cpython-311.pyc
�

���cX��t�ddlZddlZddlZddlZddlZddlZddlZejd���Zejddefd���Z	d�Z
ejejfd���Zejddefd���Z
ejd���ZGd	�d
��ZGd�dejej��ZGd
�dej��ZdS)�Nc#�K�tj��}tj|��	|V�tj|��dS#tj|��wxYw�N)�os�getcwd�chdir)�dir�origs  �C/usr/lib/python3/dist-packages/setuptools/_vendor/jaraco/context.py�pushdr
sO����
�9�;�;�D��H�S�M�M�M���	�	�	�
������������������s�A�Ac
#�K�|�Gtj�|���dd���dd��}|� t	jtjd���}|djd
it������	d}d	}d
�
||f��}||jd
dt|��it������||��5|V�ddd��n#1swxYwY|djd
it������dS#|djd
it������wxYw)z�
    Get a tarball, extract it, change to that directory, yield, then
    clean up.
    `runner` is the function to invoke commands.
    `pushd` is a context manager for changing the directory.
    Nz.tar.gz�z.tgzT)�shellzmkdir {target_dir}zwget {url} -O -z7tar x{compression} --strip-components=1 -C {target_dir}z | �compressionzrm -Rf {target_dir}�)r�path�basename�replace�	functools�partial�
subprocess�
check_call�format�vars�join�infer_compression)�url�
target_dir�runnerr�getter�extract�cmds       r
�tarball_contextr"s��������W�%�%�c�*�*�2�2�9�b�A�A�I�I�&�RT�U�U�
�
�~��"�:�#8��E�E�E��
�F�&��&�0�0����0�0�1�1�1�7�"��K���j�j�&�'�*�+�+����z�s�z�G�G�&7��&<�&<�G����G�G�H�H�H�
�U�:�
�
�	�	�����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	��+�$�+�5�5�d�f�f�5�5�6�6�6�6�6����+�$�+�5�5�d�f�f�5�5�6�6�6�6���s1�AD(�(C9�-D(�9C=�=D(�C=�D(�($Ec�f�|dd�}tddd���}|�|d��S)zF
    Given a URL or filename, infer the compression code for tar.
    ���N�z�j�J)�gz�bz�xz)�dict�get)r�compression_indicator�mappings   r
rr0s;��
 ����H���c�c�c�*�*�*�G��;�;�,�c�2�2�2�c#�pK�tj��}	|V�||��dS#||��wxYw)zk
    Create a temporary directory context. Pass a custom remover
    to override the removal behavior.
    N)�tempfile�mkdtemp)�remover�temp_dirs  r
r4r4;sP������!�!�H������������������������s�(�
5Tc#�K�d|vrdnd}|��5}|d||g}|r|�d|g��ttjjd��}|r|nd}tj||���|V�ddd��dS#1swxYwYdS)z�
    Check out the repo indicated by url.

    If dest_ctx is supplied, it should be a context manager
    to yield the target directory for the check out.
    �git�hg�clonez--branch�wN)�stdout)�extend�openrr�devnullrr)	r�branch�quiet�dest_ctx�exe�repo_dirr!r=r:s	         r
�repo_contextrCHs������C�<�<�%�%�T�C�	�����x��G�S�(�+���	-��J�J�
�F�+�,�,�,��r�w���,�,��!�+���t����c�&�1�1�1�1�������������������������s�AB�B�Bc#�K�dV�dSrrrr/r
�nullrE[s����	�E�E�E�E�Er/c��eZdZdZdZeffd�Zd�Zed���Z	ed���Z
ed���Zd�Zd	�Z
ed
�d�Zd�Zd
S)�
ExceptionTrapaG
    A context manager that will catch certain exceptions and provide an
    indication they occurred.

    >>> with ExceptionTrap() as trap:
    ...     raise Exception()
    >>> bool(trap)
    True

    >>> with ExceptionTrap() as trap:
    ...     pass
    >>> bool(trap)
    False

    >>> with ExceptionTrap(ValueError) as trap:
    ...     raise ValueError("1 + 1 is not 3")
    >>> bool(trap)
    True

    >>> with ExceptionTrap(ValueError) as trap:
    ...     raise Exception()
    Traceback (most recent call last):
    ...
    Exception

    >>> bool(trap)
    False
    )NNNc��||_dSr)�
exceptions)�selfrIs  r
�__init__zExceptionTrap.__init__�s
��$����r/c��|Srr�rJs r
�	__enter__zExceptionTrap.__enter__�����r/c��|jdS�Nr��exc_inforMs r
�typezExceptionTrap.type�����}�Q��r/c��|jdS)N�rRrMs r
�valuezExceptionTrap.value�rUr/c��|jdS)N�rRrMs r
�tbzExceptionTrap.tb�rUr/c�V�|d}|ot||j��}|r||_|SrQ)�
issubclassrIrS)rJrSrT�matchess    r
�__exit__zExceptionTrap.__exit__�s5����{���<�:�d�D�O�<�<���	%�$�D�M��r/c�*�t|j��Sr)�boolrTrMs r
�__bool__zExceptionTrap.__bool__�s���D�I���r/��_testc�N����tj������fd���}|S)a�
        Wrap func and replace the result with the truth
        value of the trap (True if an exception occurred).

        First, give the decorator an alias to support Python 3.8
        Syntax.

        >>> raises = ExceptionTrap(ValueError).raises

        Now decorate a function that always fails.

        >>> @raises
        ... def fail():
        ...     raise ValueError('failed')
        >>> fail()
        True
        c���t�j��5}�|i|��ddd��n#1swxYwY�|��Sr)rGrI)�args�kwargs�traprd�funcrJs   ���r
�wrapperz%ExceptionTrap.raises.<locals>.wrapper�s�����t��/�/�
&�4���d�%�f�%�%�%�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&����
&�
&�
&�
&��5��;�;�s�	+�/�/)r�wraps)rJrjrdrks``` r
�raiseszExceptionTrap.raises�sF�����&
���	�	�	�	�	�	�	�	�
�	�	�
�r/c�D�|�|tj���S)a�
        Wrap func and replace the result with the truth
        value of the trap (True if no exception).

        First, give the decorator an alias to support Python 3.8
        Syntax.

        >>> passes = ExceptionTrap(ValueError).passes

        Now decorate a function that always fails.

        >>> @passes
        ... def fail():
        ...     raise ValueError('failed')

        >>> fail()
        False
        rc)rm�operator�not_)rJrjs  r
�passeszExceptionTrap.passes�s��&�{�{�4�x�}�{�5�5�5r/N)�__name__�
__module__�__qualname__�__doc__rS�	ExceptionrKrN�propertyrTrXr[r_rbrarmrqrr/r
rGrG`s���������: �H�#,�,�%�%�%�%����� � ��X� �� � ��X� �� � ��X� �������%)������66�6�6�6�6r/rGc��eZdZdZdS)�suppressz�
    A version of contextlib.suppress with decorator support.

    >>> @suppress(KeyError)
    ... def key_error():
    ...     {}['']
    >>> key_error()
    N)rrrsrtrurr/r
ryry�s���������r/ryc�*�eZdZdZ		dd�Zd�Zd�ZdS)	�on_interrupta
    Replace a KeyboardInterrupt with SystemExit(1)

    >>> def do_interrupt():
    ...     raise KeyboardInterrupt()
    >>> on_interrupt('error')(do_interrupt)()
    Traceback (most recent call last):
    ...
    SystemExit: 1
    >>> on_interrupt('error', code=255)(do_interrupt)()
    Traceback (most recent call last):
    ...
    SystemExit: 255
    >>> on_interrupt('suppress')(do_interrupt)()
    >>> with __import__('pytest').raises(KeyboardInterrupt):
    ...     on_interrupt('ignore')(do_interrupt)()
    �errorrWc�"�||_||_dSr)�action�code)rJr~rs   r
rKzon_interrupt.__init__�s�������	�	�	r/c��|SrrrMs r
rNzon_interrupt.__enter__�rOr/c��|tus|jdkrdS|jdkrt|j��|�|jdkS)N�ignorer|ry)�KeyboardInterruptr~�
SystemExitr)rJ�exctype�excinst�exctbs    r
r_zon_interrupt.__exit__�sK���+�+�+�t�{�h�/F�/F��F�
�[�G�
#�
#��T�Y�'�'�W�4��{�j�(�(r/N)r|rW)rrrsrtrurKrNr_rr/r
r{r{�sZ��������(���������)�)�)�)�)r/r{)rr�
contextlibrr1�shutilro�contextmanagerrr"r�rmtreer4rCrErGry�ContextDecoratorr{rr/r
�<module>r�s���	�	�	�	�����������������
�
�
�
��������������$(��U�7�7�7���7�63�3�3����]�	�	�	���	���!���������$��
�
���
�j6�j6�j6�j6�j6�j6�j6�j6�Z�����z�"�J�$?����%)�%)�%)�%)�%)�:�.�%)�%)�%)�%)�%)r/