§
    €Ûg5
  ã                   óæ   — d Z ddlZddlZddlZ	 ddlmZ n# e$ r	 ddlmZ Y nw xY w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©Úquote)Ú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    úR/granary/edev/quantum/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>C   s   ø€ Ð6Ð6Ð6˜a��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)  ø€ àˆˆˆð	&ØŒMˆMˆMøÝð 	&ð 	&ð 	&Ý%Ð%ð	&øøøð
 ð 	ØˆIØ˜‰nˆà#œ]Ô2ÔEÐØ%+§^¢^°FÔ4DÑ%EÔ%EÐÔ"Ø'-Ô'7¸¿ºÈÌÑ9UÔ9UÐ&VÐÔ#à—’‘”ˆØ#Ð# C¨¯ª°eÑ)<Ô)<Ñ=Ô=ˆØ6Ð6Ð6Ð6¥5¨¬Ñ#5Ô#5Ð6Ñ6Ô6ˆØ”=Ô)×3Ò3°FÑ;Ô;Ð;Ð;Ð;ð �AŒw˜'Ò!Ð!Ð!Ð!Ø�A�B�BŒxˆ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   ó4   K  — | ]}t          |¦  «        V — Œd S r    r   )r%   Úargs     r   ú	<genexpr>z#PosixParser.join.<locals>.<genexpr>Q   s(   è è € Ð3Ð3 s�˜c™
œ
Ð3Ð3Ð3Ð3Ð3Ð3r   )r   r   s    r   r   zPosixParser.joinO   s#   € à�xŠxÐ3Ð3¨dÐ3Ñ3Ô3Ñ3Ô3Ð3r   c                 ó.   — t          j        | d¬¦  «        S )NT)Úposix)Úshlexr   r   s    r   r   zPosixParser.splitS   s   € åŒ{˜3 dÐ+Ñ+Ô+Ð+r   Nr   r   r   r   r   r   K   sT   € € € € € ðð ð ð4ð 4ñ „\ð4ð ð,ð ,ñ „\ð,ð ,ð ,r   r   ÚntrC   )r   ÚosrD   r!   r   ÚImportErrorÚpipesÚ__all__r	   r   r   Únamer   r   r   r   ú<module>rK      s6  ððð ð 
€	€	€	Ø €€€Ø Ð Ð Ð ðØÐÐÐÐÐÐøØð ð ð ØÐÐÐÐÐÐÐðøøøð ;Ð
:Ð
:€ð"ð "ð "ð "ð "ñ "ô "ð "ð&%ð %ð %ð %ð %ñ %ô %ð %ðP
,ð 
,ð 
,ð 
,ð 
,ñ 
,ô 
,ð 
,ð „7ˆd‚?€?Ø €L€L€LØ„W�ÒÐØ€L€L€Lð Ðs   � —%¤%