o
    Ô­j5
  ã                   @   s¦   d Z ddlZddlZddlZzddlmZ W n ey%   ddlmZ Y nw g d¢ZG dd„ dƒZG dd„ dƒZ	G d	d
„ d
ƒZ
ejdkrHe	ZdS ejdkrQe
ZdS dS )zq
Helper functions for interacting with the shell, and consuming shell-style
parameters provided in config files.
é    N©Úquote)ÚWindowsParserÚPosixParserÚNativeParserc                   @   ó(   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   ó   t ‚)z5 Join a list of arguments into a command line string ©ÚNotImplementedError©Úargv© r   úY/var/www/html/CropPilot/venv/lib/python3.10/site-packages/numpy/distutils/_shell_utils.pyÚjoin   ó   zCommandLineParser.joinc                 C   r	   )z6 Split a command line string into a list of arguments r
   ©Úcmdr   r   r   Úsplit   r   zCommandLineParser.splitN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr   r   r   r   r   r   r      s    
r   c                   @   r   )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‚w | sg S d|  } |jjj}| |j¡|_|j| |j	¡f|_
| 	¡ }|| | |¡ƒ‰ ‡ fdd„t|jƒD ƒ}|jj ˆ ¡rRJ ‚|d dksZJ ‚|dd … S )Nr   zdummy c                    s   g | ]}ˆ | ‘qS r   r   )Ú.0Úi©Úlpargsr   r   Ú
<listcomp>C   s    z'WindowsParser.split.<locals>.<listcomp>Údummyé   )ÚctypesÚwindllÚAttributeErrorr   Úshell32ÚCommandLineToArgvWÚPOINTERÚ	c_wchar_pÚrestypeÚc_intÚargtypesÚbyrefÚrangeÚvalueÚkernel32Ú	LocalFree)r   r%   r)   ÚnargsÚargsr   r    r   r   /   s$   
ÿ
zWindowsParser.splitNr   r   r   r   r   r   #   s    
r   c                   @   r   )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   s   € 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   Úntr9   )r   Úosr:   r   r   ÚImportErrorÚpipesÚ__all__r   r   r   Únamer   r   r   r   r   Ú<module>   s$    ÿ(

ÿ