\bgdZddlZddlZddlZddlZddlZddlZddlZddlm Z ej ejdkdZ GddZ d ZGd d e ZGd d e ZdS)a1 Python Script Wrapper for Windows ================================= setuptools includes wrappers for Python scripts that allows them to be executed like regular windows programs. There are 2 wrappers, one for command-line programs, cli.exe, and one for graphical programs, gui.exe. These programs are almost identical, function pretty much the same way, and are generated from the same source file. The wrapper programs are used by copying them to the directory containing the script they are to wrap and with the same name as the script they are to wrap. N) nt_quote_argwin32z Windows only)reasonc:eZdZedZedZdS) WrapperTestercVttj}|tzS)N)rsys executablelocals)clstemplate python_exes w/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/tests/test_windows_wrappers.py prep_scriptzWrapperTester.prep_scripts !#.11 &((""c||j}||jz d5}||dddn #1swxYwY||jz d5}t jd|j}||ddddS#1swxYwYdS)z Create a simple script, foo-script.py Note that the script starts with a Unix-style '#!' line saying which Python executable to run. The wrapper will use this line to find the correct Python executable. wNwb setuptools) r script_tmpl script_nameopenwrite wrapper_name pkg_resourcesresource_stringwrapper_source)r tmpdirscriptfrs r create_scriptzWrapperTester.create_script#s611s& , ,S 1 1 Q GGFOOO               s'' - -d 3 3 q-lCr?rArBzV \foo-script.py [] '' --- )r!rJrKrLrrrrDrErFrGSTDOUTrHrI) rMrtmplr rNrOr<rPrQrRs rtest_with_optionszTestCLI.test_with_optionssu 6"""     &(( & , ,S 1 1 ,Q GGD$$T** + + + , , , , , , , , , , , , , , ,6I%&&' ?/$    **,,--?    &(( !!!!!!s)B  B B N)r"r#r$rrr/rrJrKrLrrSr[rar&rrr1r1As!KL%%e,,N!(/    fhh."."."`#"#"#"J."."."."."rr1czeZdZdZdZedZdZej d Z dZ dS)TestGUIz= Testing the GUI Version ----------------------- zbar-script.pywr)bar.exez #!%(python_exe)s import sys f = open(sys.argv[1], 'wb') bytes_written = f.write(repr(sys.argv[2]).encode('utf-8')) f.close() c||t|dz t|dz dg}tj|tjtjtjdd}|\}}|rJ|rJ|dz d5}| d}d d d n #1swxYwY|tdksJd S) z:Test the GUI version with the simple script, bar-script.pyrdztest_output.txtz Test ArgumentTr:r]rbasciiN) r!rDrErFrGr_rHrreaddecoderepr)rMrrNrOr<r^f_outrQs rrSzTestGUI.test_basicsH 6""" " # # ** + +    ?/$    ))++zz(( . .t 4 4 2ZZ\\((11F 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2o........s*(CC"%C"N) r"r#r$__doc__rr/rrrJrKstriprrSr&rrrcrcso #K%%e,,NL!(/  egg/////rrc)rlrWr+rEr rJpytestrsetuptools.command.easy_installrmarkskipif pytestmarkrr/r1rcr&rrrss'    888888 [    7  O O 6***U"U"U"U"U"mU"U"U"p*/*/*/*/*/m*/*/*/*/*/r