grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|joã@sÄddlZddlZddlZddlZddlZddlZddlZgd¢ZdZej   d¡r+dZ ne  ¡Z Gdd„de ƒZejdd „ƒZd d „Zdd d „Z  ddd„Zdd„Zddd„Zedkr`eƒdSdS)éN)Ú ZipAppErrorÚcreate_archiveÚget_interpreterz8# -*- coding: utf-8 -*- import {module} {module}.{fn}() Úwinúutf-8c@s eZdZdS)rN)Ú__name__Ú __module__Ú __qualname__©r r ú-/opt/alt/python310/lib64/python3.10/zipapp.pyr!srccsR�t|ttjfƒr$t||ƒ� }|VWdƒdS1swYdS|VdS©N)Ú isinstanceÚstrÚosÚPathLikeÚopen)ÚarchiveÚmodeÚfr r r Ú _maybe_open%s € "ÿ rcCs(|rd| t¡d}| |¡dSdS)zWrite a shebang line.ó#!ó N)ÚencodeÚshebang_encodingÚwrite)rÚ interpreterZshebangr r r Ú_write_file_prefix.sþrc CsÆt|dƒ�<}| d¡}|dkrd}| ¡t|dƒ�}t||ƒ| |¡t ||¡Wdƒn1s5wYWdƒn1sDwY|r_t|tƒrat   |t   |¡j t j B¡dSdSdS)z8Copy an application archive, modifying the shebang line.ÚrbéróÚwbN)rÚreadÚreadlinerrÚshutilZ copyfileobjr rrÚchmodÚstatÚst_modeÚS_IEXEC)rZ new_archiverÚsrcZfirst_2Zdstr r r Ú _copy_archive5s     ú€÷ÿr)Fc Csd}t|dƒrt|dƒrd}n t |¡}| ¡rd}|r$t|||ƒdS| ¡s,tdƒ‚|d ¡}|r:|r:tdƒ‚|sB|sBtd ƒ‚d}|r{| d ¡\} } } td d „|   d ¡Dƒƒ} tdd „|   d ¡Dƒƒ} | d krn| rn| sttd|ƒ‚t j | | d�}|dur…|  d¡}n t|dƒs�t |¡}t |dƒ�U}t||ƒ|rŸtjntj}tj|d|d��0}| d¡D]}| |¡}|dus¿||ƒrÇ| || ¡¡q°|rÓ| d| d¡¡Wdƒn1sÝwYWdƒn1sìwY|�rt|dƒ�s | | ¡jtjB¡dSdSdS)abCreate an application archive from SOURCE. The SOURCE can be the name of a directory, or a filename or a file-like object referring to an existing archive. The content of SOURCE is packed into an application archive in TARGET, which can be a filename or a file-like object. If SOURCE is a directory, TARGET can be omitted and will default to the name of SOURCE with .pyz appended. The created application archive will have a shebang line specifying that it should run with INTERPRETER (there will be no shebang line if INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is not specified, an existing __main__.py will be used). It is an error to specify MAIN for anything other than a directory source with no __main__.py, and it is an error to omit MAIN if the directory has no __main__.py. Fr!r"TNzSource does not existz __main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry pointú:csó�|]}| ¡VqdSr ©Ú isidentifier©Ú.0Úpartr r r Ú {ó€z!create_archive..Ú.csr+r r,r.r r r r1|r2zInvalid entry point: )ÚmoduleÚfnz.pyzrr Úw)Ú compressionÚ*r)ÚhasattrÚpathlibZPathÚis_filer)ÚexistsrÚ partitionÚallÚsplitÚ MAIN_TEMPLATEÚformatZ with_suffixrrÚzipfileZ ZIP_DEFLATEDZ ZIP_STOREDZZipFileZrglobZ relative_torZas_posixZwritestrrr$r%r&r')ÚsourceÚtargetrÚmainÚfilterÚ compressedZsource_is_fileZhas_mainZmain_pyÚmodÚsepr5Zmod_okZfn_okÚfdr7ÚzÚchildZarcnamer r r rLsd   ÿ       ÿ €€ú€ü ÿrcCs^t|dƒ� }| d¡dkr| ¡ ¡ t¡WdƒSWdƒdS1s(wYdS)Nrrr)rr!r"ÚstripÚdecoder)rrr r r r–s þ"ÿrcCs2ddl}| ¡}|jddddd�|jdddd d�|jd d dd d�|jd dddd�|jddddd�|jddd�| |¡}|jrbtj |j¡sOt dƒ‚t |jƒ}t d  |pZd¡ƒt  d¡tj |j¡r‰|jdus~tj |j¡r‚tj |j|j¡r‚t dƒ‚|jr‰t dƒ‚t|j|j|j|j|jd�dS)zÞRun the zipapp command line interface. The ARGS parameter lets you specify the argument list directly. Omitting ARGS (or setting it to None) works as for argparse, using sys.argv[1:] as the argument list. rNz--outputz-ozAThe name of the output archive. Required if SOURCE is an archive.)ÚdefaultÚhelpz--pythonz-pzEThe name of the Python interpreter to use (default: no shebang line).z--mainz-mzLThe main function of the application (default: use an existing __main__.py).z --compressz-cÚ store_truezQCompress files with the deflate method. Files are stored uncompressed by default.)ÚactionrPz--infoFz)Display the interpreter from the archive.)rOrRrPrCz'Source directory (or existing archive).)rPz%Can only get info for an archive filezInterpreter: {}zz-In-place editing of archives is not supportedz,Cannot change the main function when copying)rrErG)ÚargparseÚArgumentParserÚ add_argumentÚ parse_argsÚinforÚpathÚisfilerCÚ SystemExitrÚprintrAÚsysÚexitÚoutputr<ÚsamefilerErZpythonÚcompress)ÚargsrSÚparserrr r r rEœsL ÿ ÿ ÿ ÿ ÿÿ   ÿ  þrEÚ__main__r )NNNNF)Ú contextlibrr:r#r%r\rBÚ__all__r@ÚplatformÚ startswithrÚgetfilesystemencodingÚ ValueErrorrÚcontextmanagerrrr)rrrErr r r r Ús2    ÿJ 1 ÿ