Ë ˆ\öäú÷}Jã ó—UdZddlZddlZddlZddlmZddlmZmZm Z m Z ddl m Z erddlm Z e dZe dZd d gZd d d ddddddœZee defed<dZdedefd„Zdededefd„ZGd„d e«ZGd„d «Zy)z2Generate executable scripts, on various platforms.éN)Ú read_binary)Ú TYPE_CHECKINGÚMappingÚOptionalÚTuple)Ú_scripts)ÚLiteral)Úposixúwin-ia32ú win-amd64úwin-armú win-arm64)ÚconsoleÚguiÚ InvalidScriptÚScriptzt32.exezt64.exez t_arm.exez t64-arm.exezw32.exezw64.exez w_arm.exez w64-arm.exe))rr )rr )rr )rr)rr )rr )rr )rr)Ú ScriptSectionÚ LauncherKindÚ_ALLOWED_LAUNCHERSzÌ# -*- coding: utf-8 -*- import re import sys from {module} import {import_name} if __name__ == "__main__": sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0]) sys.exit({func_path}()) Ú executableÚreturncó2—d|vryt|«dz}|dkS)Nó Féé)Úlen)rÚshebang_lengths ú6/usr/lib/python3.12/site-packages/installer/scripts.pyÚ_is_executable_simpler+s(€Ø ˆzÑØÜ˜“_ qÑ(€Nð ˜SÑ Ð óÚ forlaunchercó.—|jd«}d|zS)aBuild a shebang line. The non-launcher cases are taken directly from distlib's implementation, which tries its best to account for command length, spaces in path, etc. https://bitbucket.org/pypa/distlib/src/58cd5c6/distlib/scripts.py#lines-124 úutf-8s#!)Úencode)rr!Úexecutable_bytess rÚ_build_shebangr&5s!€ð"×(Ñ(¨Ó1ÐØ Ð#Ñ #Ð#r có—eZdZdZy)rz=Raised if the user provides incorrect script section or kind.N)Ú__name__Ú __module__Ú __qualname__Ú__doc__©r rrrAs„ÚGr c óp—eZdZdZdZdedededddd f d „Zdefd „Zd d dee fd„Z ded d de ee ffd„Z y )rz7Describes a script based on an entry point declaration.©ÚnameÚmoduleÚattrÚsectionr/r0r1r2rrNcó<—||_||_||_||_y)axConstruct a Script object. :param name: name of the script :param module: module path, to load the entry point from :param attr: final attribute access, for the entry point :param section: Denotes the "entry point section" where this was specified. Valid values are ``"gui"`` and ``"console"``. :type section: str Nr.)Úselfr/r0r1r2s rÚ__init__zScript.__init__Js €ðˆŒ ؈Œ ؈Œ ؈� r cód—dj|j|j|j«S)Nz(Script(name={!r}, module={!r}, attr={!r})Úformatr/r0r1)r4s rÚ__repr__zScript.__repr__\s*€Ø9×@Ñ@Ø �I‰IØ �K‰KØ �I‰Ió ð r Úkindrcó¶—|dk(ry|j|f} t|}t t |«S#t$r |›dtt«›�}t |«‚wxYw)Nr z not in )r2rÚKeyErrorÚsortedrrr)r4r9Úkeyr/Úerrors rÚ_get_launcher_datazScript._get_launcher_datacsk€Ø �7Š?ØØ�|‰|˜TÐ"ˆð 'Ü% cÑ*ˆDôœ8 TÓ*Ð*øôò 'Ø�g˜X¤fÔ-?Ó&@Ð%CÐDˆEÜ Ó&Ð &ð 'ús – /¯)Arcó$—|j|«}t|t|«¬«}tj |j |j jd«d|j ¬«jd«}|€|j|dz|zfStj«}tj|d«5}|jd |«ddd«|j›d �}||zdz|j«z} || fS#1swYŒ5xYw) a¯Generate a launcher for this script. :param executable: Path to the executable to invoke. :param kind: Which launcher template should be used. Valid values are ``"posix"``, ``"win-ia32"``, ``"win-amd64"`` and ``"win-arm"``. :type kind: str :raises InvalidScript: if no appropriate template is available. :return: The name and contents of the launcher file. )r!Ú.r)r0Ú import_nameÚ func_pathr#Nó Úwz __main__.pyz.exe)r?r&ÚboolÚ_SCRIPT_TEMPLATEr7r0r1Úsplitr$r/ÚioÚBytesIOÚzipfileÚZipFileÚwritestrÚgetvalue) r4rr9ÚlauncherÚshebangÚcodeÚstreamÚzfr/Údatas rÚgeneratezScript.generatensö€ð×*Ñ*¨4Ó0ˆÜ  ¼¸h»ÔHˆÜ×&Ñ&Ø—;‘;ØŸ ™ Ÿ™¨Ó,¨QÑ/Ø—i‘ið'ó ÷ ‰&�‹/ð ð Ð Ø—I‘I˜w¨™°Ñ5Ð6Ð 6ä—‘“ˆÜ �_‰_˜V SÔ )¨RØ �K‰K˜  tÔ ,÷*à—)‘)�˜DÐ!ˆØ˜'Ñ! EÑ)¨F¯O©OÓ,=Ñ=ˆØ�dˆ|Ð÷ *Ð )ús Â?DÄD) r(r)r*r+Ú __slots__Ústrr5r8rÚbytesr?rrUr,r rrrEs}„ÙAà5€IðØðØ!$ðØ,/ðØ:Iðà óð$ ˜#ó ð + ~ð +¸(À5¹/ó +ð 3ð¨nðÀÀsÈEÀzÑARôr )r+rIÚshlexrKÚimportlib.resourcesrÚtypingrrrrÚ installerrr rrÚ__all__rrWÚ__annotations__rGrXrFrr&Ú ValueErrorrrr,r rÚr`sÎðÚ8ã Û ÛÝ+ß:Ó:åáÝàÐSÑT€LØÐ,Ñ-€Mð ˜HÐ %€ð'Ø'Ø'Ø+Ø"Ø#Ø#Ø'ñ LÐ�G˜EÐ"AÑBÀCÐGÑHó ðÐð! eð!°ó!ð $˜sð $°ð $¸%ó $ôH�JôH÷EòEr