HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/numpy/distutils/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/numpy/distutils/__pycache__/_shell_utils.cpython-36.pyc
3

���h5
�@s�dZddlZddlZddlZyddlmZWn ek
rLddlmZYnXdddgZGdd�d�ZGd	d�d�Z	Gd
d�d�Z
ejdkr�e	Znejdkr�e
ZdS)
zq
Helper functions for interacting with the shell, and consuming shell-style
parameters provided in config files.
�N)�quote�
WindowsParser�PosixParser�NativeParserc@s(eZdZdZedd��Zedd��ZdS)�CommandLineParsera

    An object that knows how to split and join command-line arguments.

    It must be true that ``argv == split(join(argv))`` for all ``argv``.
    The reverse neednt be true - `join(split(cmd))` may result in the addition
    or removal of unnecessary escaping.
    cCst�dS)z5 Join a list of arguments into a command line string N)�NotImplementedError)�argv�r	�=/tmp/pip-build-5_djhm0z/numpy/numpy/distutils/_shell_utils.py�joinszCommandLineParser.joincCst�dS)z6 Split a command line string into a list of arguments N)r)�cmdr	r	r
�splitszCommandLineParser.splitN)�__name__�
__module__�__qualname__�__doc__�staticmethodrr
r	r	r	r
rsrc@s(eZdZdZedd��Zedd��ZdS)rz�
    The parsing behavior used by `subprocess.call("string")` on Windows, which
    matches the Microsoft C/C++ runtime.

    Note that this is _not_ the behavior of cmd.
    cCs
tj|�S)N)�
subprocess�list2cmdline)rr	r	r
r*szWindowsParser.joincs�ddl}y
|jWntk
r*t�YnX|s4gSd|}|jjj}|j|j�|_|j|j|j	�f|_
|j	�}|||j|����fdd�t|j
�D�}|jjj��s�t�|ddks�t�|dd�S)Nrzdummy csg|]}�|�qSr	r	)�.0�i)�lpargsr	r
�
<listcomp>Csz'WindowsParser.split.<locals>.<listcomp>�dummy�)�ctypes�windll�AttributeErrorr�shell32�CommandLineToArgvW�POINTER�	c_wchar_p�restype�c_int�argtypes�byref�range�value�kernel32Z	LocalFree�AssertionError)rrr�nargs�argsr	)rr
r
/s"


zWindowsParser.splitN)rrrrrrr
r	r	r	r
r#sc@s(eZdZdZedd��Zedd��ZdS)rzX
    The parsing behavior used by `subprocess.call("string", shell=True)` on Posix.
    cCsdjdd�|D��S)N� css|]}t|�VqdS)N)r)r�argr	r	r
�	<genexpr>Qsz#PosixParser.join.<locals>.<genexpr>)r)rr	r	r
rOszPosixParser.joincCstj|dd�S)NT)�posix)�shlexr
)rr	r	r
r
SszPosixParser.splitN)rrrrrrr
r	r	r	r
rKs�ntr/)
r�osr0rr�ImportErrorZpipes�__all__rrr�namerr	r	r	r
�<module>s
(