
    G/Ph	                         d Z ddlZddlZddlZg dZ G d d          Z G d d          Z G d d	          Zej        d
k    reZ	dS ej        dk    reZ	dS dS )zq
Helper functions for interacting with the shell, and consuming shell-style
parameters provided in config files.
    N)WindowsParserPosixParserNativeParserc                   >    e Zd ZdZed             Ze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                     t           )z5 Join a list of arguments into a command line string NotImplementedErrorargvs    \/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numpy/distutils/_shell_utils.pyjoinzCommandLineParser.join   
     "!    c                     t           )z6 Split a command line string into a list of arguments r	   cmds    r   splitzCommandLineParser.split   r   r   N__name__
__module____qualname____doc__staticmethodr   r    r   r   r   r      sT          " " \" " " \" " "r   r   c                   >    e Zd ZdZed             Ze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                 *    t          j        |           S N)
subprocesslist2cmdliner   s    r   r   zWindowsParser.join&   s     &t,,,r   c                    dd l }	 |j         n# t          $ r t          w xY w| sg S d| z   } |j        j        j        }|                    |j                  |_        |j        |                    |j	                  f|_
        |	                                } || |                    |                    fdt          |j                  D             }|j        j                                      rJ |d         dk    sJ |dd          S )Nr   zdummy c                      g | ]
}|         S r   r   ).0ilpargss     r   
<listcomp>z'WindowsParser.split.<locals>.<listcomp>?   s    666aq	666r   dummy   )ctypeswindllAttributeErrorr
   shell32CommandLineToArgvWPOINTER	c_wchar_prestypec_intargtypesbyrefrangevaluekernel32	LocalFree)r   r)   r-   nargsargsr%   s        @r   r   zWindowsParser.split+   s)   	&MMM 	& 	& 	&%%	&
  	In#]2E%+^^F4D%E%E"'-'79U9U&V###Ce)<)<==66665#5#5666=)33F;;;;; Aw'!!!!ABBxs    !Nr   r   r   r   r   r      sT          - - \-   \  r   r   c                   >    e Zd ZdZed             Zed             ZdS )r   zX
    The parsing behavior used by `subprocess.call("string", shell=True)` on Posix.
    c                 @    d                     d | D                       S )N c              3   >   K   | ]}t          j        |          V  d S r   )shlexquote)r#   args     r   	<genexpr>z#PosixParser.join.<locals>.<genexpr>M   s,      99SC((999999r   )r   r   s    r   r   zPosixParser.joinK   s#    xx99D999999r   c                 .    t          j        | d          S )NT)posix)r>   r   r   s    r   r   zPosixParser.splitO   s    {3d++++r   Nr   r   r   r   r   r   G   sT          : : \: , , \, , ,r   r   ntrC   )
r   osr>   r   __all__r   r   r   namer   r   r   r   <module>rH      s     
			     
:
:
:" " " " " " " "&% % % % % % % %P
, 
, 
, 
, 
, 
, 
, 
, 7d?? LLLWLLL r   