a
    p=ic5
                     @   s   d Z ddlZddlZddlZzddlmZ W n eyJ   ddlmZ Y n0 g dZG dd dZG dd dZ	G d	d
 d
Z
ejdkre	Znejdkre
ZdS )zq
Helper functions for interacting with the shell, and consuming shell-style
parameters provided in config files.
    Nquote)WindowsParserPosixParserNativeParserc                   @   s(   e Zd ZdZedd Zedd ZdS )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.
    c                 C   s   t dS )z5 Join a list of arguments into a command line string NNotImplementedErrorargv r   m/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/lib/python3.9/site-packages/numpy/distutils/_shell_utils.pyjoin   s    zCommandLineParser.joinc                 C   s   t dS )z6 Split a command line string into a list of arguments Nr   cmdr   r   r   split   s    zCommandLineParser.splitN__name__
__module____qualname____doc__staticmethodr   r   r   r   r   r   r      s
   
r   c                   @   s(   e Zd ZdZedd Zedd ZdS )r   z
    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.
    c                 C   s
   t | S N)
subprocesslist2cmdliner
   r   r   r   r   *   s    zWindowsParser.joinc                    s   dd l }z
|j W n ty(   tY n0 | s2g S d|  } |jjj}||j|_|j||j	f|_
|	 }|| ||  fddt|jD }|jj rJ |d dksJ |dd  S )Nr   zdummy c                    s   g | ]} | qS r   r   ).0iZlpargsr   r   
<listcomp>C       z'WindowsParser.split.<locals>.<listcomp>dummy   )ctypeswindllAttributeErrorr	   Zshell32CommandLineToArgvWPOINTER	c_wchar_prestypec_intargtypesbyrefrangevalueZkernel32Z	LocalFree)r   r"   r%   nargsargsr   r   r   r   /   s"    


zWindowsParser.splitNr   r   r   r   r   r   #   s
   
r   c                   @   s(   e Zd ZdZedd Zedd ZdS )r   zX
    The parsing behavior used by `subprocess.call("string", shell=True)` on Posix.
    c                 C   s   d dd | D S )N c                 s   s   | ]}t |V  qd S r   r   )r   argr   r   r   	<genexpr>Q   r   z#PosixParser.join.<locals>.<genexpr>)r   r
   r   r   r   r   O   s    zPosixParser.joinc                 C   s   t j| ddS )NT)posix)shlexr   r   r   r   r   r   S   s    zPosixParser.splitNr   r   r   r   r   r   K   s
   
r   ntr3   )r   osr4   r   r   ImportErrorZpipes__all__r   r   r   namer   r   r   r   r   <module>   s   (

