← back to Atmos Game

assets/gen/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_subprocesses.cpython-312.pyc

96 lines

�

c�bj����UddlmZddlmZmZmZmZddlmZddl	m
Z
ddlmZm
Z
mZddlmZmZmZmZddlmZd	d
lmZd	dlmZeeze
eze
ezZded
<ddeedddddddddddd�																																	dd�Zeeeddddddddddd�
																													dd�Zy)�)�annotations)�
AsyncIterable�Iterable�Mapping�Sequence)�BytesIO)�PathLike)�PIPE�CalledProcessError�CompletedProcess)�IO�Any�	TypeAlias�cast�)�Process�)�get_async_backend)�create_task_groupr�StrOrBytesPathNTF������)�input�stdin�stdout�stderr�check�cwd�env�startupinfo�
creationflags�start_new_session�pass_fds�user�group�extra_groups�umaskc����K�d�fd�}|�
|�td��t||rtn|||||||	|
|||
||���d{���4�d{���}ddg�t�4�d{���}|jr|j||jd�|jr|j||jd�|jrG|rE|jj|��d{���|jj��d{���|j��d{���ddd��d{���ddd��d{����\}}|r5jdk7r&ttt|j�|||��t|ttj�||�S7��d7��^7��J7��7��7��7��#1�d{���7swY��xYw7��#1�d{���7swY��xYw�w)a�
    Run an external command in a subprocess and wait until it completes.

    .. seealso:: :func:`subprocess.run`

    :param command: either a string to pass to the shell, or an iterable of strings
        containing the executable name or path and its arguments
    :param input: bytes passed to the standard input of the subprocess
    :param stdin: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`,
        a file-like object, or `None`; ``input`` overrides this
    :param stdout: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`,
        a file-like object, or `None`
    :param stderr: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`,
        :data:`subprocess.STDOUT`, a file-like object, or `None`
    :param check: if ``True``, raise :exc:`~subprocess.CalledProcessError` if the
        process terminates with a return code other than 0
    :param cwd: If not ``None``, change the working directory to this before running the
        command
    :param env: if not ``None``, this mapping replaces the inherited environment
        variables from the parent process
    :param startupinfo: an instance of :class:`subprocess.STARTUPINFO` that can be used
        to specify process startup parameters (Windows only)
    :param creationflags: flags that can be used to control the creation of the
        subprocess (see :class:`subprocess.Popen` for the specifics)
    :param start_new_session: if ``true`` the setsid() system call will be made in the
        child process prior to the execution of the subprocess. (POSIX only)
    :param pass_fds: sequence of file descriptors to keep open between the parent and
        child processes. (POSIX only)
    :param user: effective user to run the process as (Python >= 3.9, POSIX only)
    :param group: effective group to run the process as (Python >= 3.9, POSIX only)
    :param extra_groups: supplementary groups to set in the subprocess (Python >= 3.9,
        POSIX only)
    :param umask: if not negative, this umask is applied in the child process before
        running the given command (Python >= 3.9, POSIX only)
    :return: an object representing the completed process
    :raises ~subprocess.CalledProcessError: if ``check`` is ``True`` and the process
        exits with a nonzero return code

    c���K�t�}|23d{���}|j|��7�6|j��|<y�w)N)r�write�getvalue)�stream�index�buffer�chunk�stream_contentss    ��p/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/anyio/_core/_subprocesses.py�drain_streamz!run_process.<locals>.drain_streamKs?��������!�	 �%��L�L���	 ��6�"(���!2����s�
A�-�+�-�A�-�ANz&only one of stdin and input is allowed�
rrrrrr r!r"r#r$r%r&r'rr)r,zAsyncIterable[bytes]r-�int�return�None)�
ValueError�open_processr
rr�
start_soonrr�send�aclose�wait�
returncoderrr4r)�commandrrrrrrrr r!r"r#r$r%r&r'r2�process�tg�output�errorsr0s                     @r1�run_processrCs������v3�
��U�.��A�B�B�!���d�������#�+��
��!������
�/3�T�l��$�&�&�"��~�~��
�
�l�G�N�N�A�>��~�~��
�
�l�G�N�N�A�>��}�}���m�m�(�(��/�/�/��m�m�*�*�,�,�,��,�,�.� � �'�&�#��<%�N�F�F���#�#�q�(� ��c�7�+=�+=�!>���QW�X�X��G�T�#�w�/A�/A�%B�F�F�S�S�E����"'��0��,�� ��'��&�&�&��#�����s��:G�F!�G�F$�G�
G	�F'�G	�!A?F2� F*�!!F2�F,�F2�F.�F2�G	�*F0�+G	�/G�:G�;A'G�$G�'G	�*F2�,F2�.F2�0G	�2G	�8F;�9G	�G	�G�	G�G�G�Gr3c

��K�i}|
�|
|d<|�||d<|�||d<|
dk\r|
|d<t�j|f|||||||||	d�	|���d{���S7��w)a
    Start an external command in a subprocess.

    .. seealso:: :class:`subprocess.Popen`

    :param command: either a string to pass to the shell, or an iterable of strings
        containing the executable name or path and its arguments
    :param stdin: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`, a
        file-like object, or ``None``
    :param stdout: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`,
        a file-like object, or ``None``
    :param stderr: one of :data:`subprocess.PIPE`, :data:`subprocess.DEVNULL`,
        :data:`subprocess.STDOUT`, a file-like object, or ``None``
    :param cwd: If not ``None``, the working directory is changed before executing
    :param env: If env is not ``None``, it must be a mapping that defines the
        environment variables for the new process
    :param creationflags: flags that can be used to control the creation of the
        subprocess (see :class:`subprocess.Popen` for the specifics)
    :param startupinfo: an instance of :class:`subprocess.STARTUPINFO` that can be used
        to specify process startup parameters (Windows only)
    :param start_new_session: if ``true`` the setsid() system call will be made in the
        child process prior to the execution of the subprocess. (POSIX only)
    :param pass_fds: sequence of file descriptors to keep open between the parent and
        child processes. (POSIX only)
    :param user: effective user to run the process as (POSIX only)
    :param group: effective group to run the process as (POSIX only)
    :param extra_groups: supplementary groups to set in the subprocess (POSIX only)
    :param umask: if not negative, this umask is applied in the child process before
        running the given command (POSIX only)
    :return: an asynchronous process object

    Nr$r%r&rr')	rrrrrr r!r"r#)rr8)r>rrrrrr r!r"r#r$r%r&r'�kwargss               r1r8r8zs�����b �F�����v������w����!-��~����z���w��1�"�$�1�1���������#�+��������s�A
A�A�
A)"r>�)StrOrBytesPath | Sequence[StrOrBytesPath]rzbytes | Noner�int | IO[Any] | NonerrGrrGr�boolr�StrOrBytesPath | Noner�Mapping[str, str] | Noner rr!r4r"rHr#�
Sequence[int]r$�str | int | Noner%rLr&�Iterable[str | int] | Noner'r4r5zCompletedProcess[bytes])r>rFrrGrrGrrGrrIrrJr rr!r4r"rHr#rKr$rLr%rLr&rMr'r4r5r) �
__future__r�collections.abcrrrr�ior�osr	�
subprocessr
rr�typingr
rrr�abcr�
_eventloopr�_tasksr�str�bytesr�__annotations__rCr8r�r1�<module>r[s��"�F�F���A�A�+�+��)�%��%�K�(�3�-�7�(�5�/�I��	�I��"&�#'�#'��!%�$(���#� �!�"�/3��#gT�
6�gT��gT� �	gT�

!�gT�
!�
gT��gT�
�gT�
"�gT��gT��gT��gT��gT��gT��gT� -�!gT�"�#gT�$�%gT�Z#'�#'�#'�!%�$(���#� �!�"�/3��J�
6�J� �J�
!�	J�

!�J�
�
J�
"�J��J��J��J��J��J��J�-�J��J� 
�!JrZ