bg5 dZddlZddlZddlZ ddlmZn#e$r ddlmZYnwxYwgdZGddZGddZ Gd d Z ej d kre Z dSej d kre Z dSdS) zq Helper functions for interacting with the shell, and consuming shell-style parameters provided in config files. Nquote) WindowsParser PosixParser NativeParserc>eZdZdZedZedZdS)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. ct)z5 Join a list of arguments into a command line string NotImplementedErrorargvs o/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib64/python3.11/site-packages/numpy/distutils/_shell_utils.pyjoinzCommandLineParser.join "!ct)z6 Split a command line string into a list of arguments r cmds rsplitzCommandLineParser.splitrrN__name__ __module__ __qualname____doc__ staticmethodrrrrr r sT""\"""\"""rr c>eZdZdZedZedZdS)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. c*tj|SN) subprocess list2cmdliner s rrzWindowsParser.join*s&t,,,rcddl} |jn#t$rtwxYw|sgSd|z}|jjj}||j|_|j||j f|_ | }||| |fdt|j D}|jjrJ|ddksJ|ddS)Nrzdummy c g|] }| Srr).0ilpargss r z'WindowsParser.split..Cs666aq 666rdummy)ctypeswindllAttributeErrorr shell32CommandLineToArgvWPOINTER c_wchar_prestypec_intargtypesbyrefrangevaluekernel32 LocalFree)rr+r/nargsargsr's @rrzWindowsParser.split/s)  & MMM & & &% % &  In#]2E%+^^F4D%E%E"'-'7 9U9U&V# ##Ce)<)<==66665#5#5666=)33F;;;;;Aw'!!!!ABBxs!Nrrrrrr#sT --\-\rrc>eZdZdZedZedZdS)rzX The parsing behavior used by `subprocess.call("string", shell=True)` on Posix. c@dd|DS)N c34K|]}t|VdSr r)r%args r z#PosixParser.join..Qs(33sc 333333r)rr s rrzPosixParser.joinOs#xx33d333333rc.tj|dS)NT)posix)shlexrrs rrzPosixParser.splitSs{3d++++rNrrrrrrKsT44\4,,\,,,rrntrC) rosrDr!r ImportErrorpipes__all__r rrnamerrrrrKs6  ; : :""""""""&%%%%%%%%P , , , , , , , ,7d?? LLLWLLLs  %%