Qfw"ddlZddlZddlZddlZddlZddlZddlZgdZdZejjdrdZ nejZ Gdde ZejdZd Zdd Z dd Zd Zdd Zedk(reyy)N) ZipAppErrorcreate_archiveget_interpreterz8# -*- coding: utf-8 -*- import {module} {module}.{fn}() winutf-8c eZdZy)rN)__name__ __module__ __qualname__-/opt/alt/python312/lib64/python3.12/zipapp.pyrr!sr rc#Kt|ttjfrt ||5}|dddy|y#1swYyxYwwN) isinstancestrosPathLikeopen)archivemodefs r _maybe_openr%sA'C-. '4 AG!  ! s-AAAA Acb|r-d|jtzdz}|j|yy)zWrite a shebang line.#! N)encodeshebang_encodingwrite)r interpretershebangs r_write_file_prefixr".s1+,,-=>>F r ct|d5}|jd}|dk(rd}|jt|d5}t|||j |t j ||dddddd|rVt|trEtj|tj|jtjzyyy#1swYjxYw#1swYnxYw)z8Copy an application archive, modifying the shebang line.rbrr wbN)rreadreadliner"rshutil copyfileobjrrrchmodstatst_modeS_IEXEC)r new_archiver srcfirst_2dsts r _copy_archiver35s Wd #s((1+ e G LLN d +s sK 0 IIg    sC ( , $"z+s3 bggk2::T\\IJ4{, + $ #s#5C+4C6C+C( $C++C4cHd}t|drt|drd}n'tj|}|jrd}|rt |||y|j s t d|dz j}|r |r t d|s |s t d d}|r|jd \} } } td | jd D} td | jd D} | d k(r| r| st d|ztj| | }||jd}n!t|dstj|}t|d5}t|||rtj ntj"}tj$|d|5}t'|j)dD]>}|j+|}| ||s|j-||j/@|r!|j1d|j3ddddddd|rHt|ds;|j5|j7j8t6j:zyyy#1swY\xYw#1swY`xYw)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:c3<K|]}|jywr isidentifier.0parts r z!create_archive..{sD^TT&&(^.c3<K|]}|jywrr7r9s rr<z!create_archive..|sBMDD%%'Mr=zInvalid entry point: )modulefnz.pyzrr&w) compression*r)hasattrpathlibPathis_filer3existsr partitionallsplit MAIN_TEMPLATEformat with_suffixrr"zipfile ZIP_DEFLATED ZIP_STOREDZipFilesortedrglob relative_toras_posixwritestrrr+r,r-r.)sourcetargetr mainfilter compressedsource_is_filehas_mainmain_pymodseprAmod_okfn_okfdrCzchildarcnames rrrLsE*Nvv76:#>f% >> !Nffk2 ==?122&//1H  FH H H677G ~~c* S"DSYYs^DDBBHHSMBBs v%5<= =&&cb&9 ~##F+ VW %f% VT "b2{+/9w++))  __R+ >! S 12++F3>VG_GGE7#3#3#563 ='..*AB ? #7673 V[[]**T\\9:4{? > # "s,+AJ29J ,AJ 1J J JJ!ct|d5}|jddk(r:|jjj t cdddS dddy#1swYyxYw)Nr$r%r)rr'r(stripdecoder)rrs rrrsW Wd #q 66!9 ::<%%'../?@AA  $ # #s AA&&A/cBddl}|j}|jdddd|jdddd |jd d dd |jd ddd|jdddd|jdd|j|}|jr|t j j|js tdt|j}tdj|xsdtjdt j j|jr|j]t j j!|jr?t j j#|j|jr td|j$r tdt'|j|j|j(|j$|j*y)zRun 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.)defaulthelpz--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.)actionrnz--infoFz)Display the interpreter from the archive.)rmrprnrYz'Source directory (or existing archive).)rnz%Can only get info for an archive filezInterpreter: {}zz-In-place editing of archives is not supportedz,Cannot change the main function when copying)r r[r])argparseArgumentParser add_argument parse_argsinforpathisfilerY SystemExitrprintrNsysexitoutputrIsamefiler[rpythoncompress)argsrqparserr s rr[r[s  $ $ &F  D$56  D$/0 $;<  d<=> % <> :<   T "D yyww~~dkk*DE E%dkk2  &&{'>h?@   ww~~dkk" ;; 277>>$++#>#%77#3#3DKK#MLM M 99KL L4;; #{{"mm-r __main__r)NNNNF) contextlibrrFr)r,rzrP__all__rMplatform startswithrgetfilesystemencoding ValueErrorrcontextmanagerrr"r3rrr[r r r rrs   > <<5!0s002 *  K.@D+0G;TA .-b zFr