
    ~(phG                        S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SKJ	r	  SSK
JrJrJr  SSKJr  SSKJrJrJrJrJrJr  \R.                  " \5      rSR5                  5       r\R8                  " S	5      rS
rS r\r  " S S\!5      r"g)    )BytesION)ZipInfo   )	sysconfigdetect_encodingZipFile)finder)FileOperatorget_export_entryconvert_pathget_executableget_platformin_venva  
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 <assemblyIdentity version="1.0.0.0"
 processorArchitecture="X86"
 name="%s"
 type="win32"/>

 <!-- Identify the application security requirements. -->
 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
 <security>
 <requestedPrivileges>
 <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
 </requestedPrivileges>
 </security>
 </trustInfo>
</assembly>s   ^#!.*pythonw?[0-9.]*([ 	].*)?$z# -*- coding: utf-8 -*-
import re
import sys
from %(module)s import %(import_name)s
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(%(func)s())
c                     SU ;   am  U R                  S5      (       a<  U R                  SS5      u  pSU;   a   UR                  S5      (       d
  U< SU< S3n U $ U R                  S5      (       d  SU -  n U $ )N z/usr/bin/env r   "z "z"%s")
startswithsplit)
executableenv_executables      B/var/www/html/venv/lib/python3.13/site-packages/distlib/scripts.pyenquote_executabler   5   s    
j
   11)//Q7Ck!+*@*@*E*E*-{;
  ((--#j0
    c                   p   \ rS rSrSr\rSr   SS jrS r	\
R                  R                  S5      (       a  S rS rS	 rSS
 jrS r\rS rS rSrS rSS jrS r\S 5       r\R8                  S 5       r\R<                  S:X  d   \R<                  S:X  a  \R>                  S:X  a  S r SS jr!SS jr"Sr#g)ScriptMakerI   zS
A class to copy or create scripts from source scripts or callable
specifications.
Nc                    Xl         X l        X0l        SU l        SU l        [
        R                  S:H  =(       d-    [
        R                  S:H  =(       a    [
        R                  S:H  U l        [        S5      U l
        U=(       d    [        U5      U l        [
        R                  S:H  =(       d-    [
        R                  S:H  =(       a    [
        R                  S:H  U l        [        R                  U l        g )NFposixjava) X.Ynt)
source_dir
target_diradd_launchersforceclobberosname_nameset_modesetvariantsr
   _fileop_is_ntsysversion_info)selfr$   r%   r&   dry_runfileops         r   __init__ScriptMaker.__init__R   s     %$*
G+ JF1B 2I57XX5H 	K(6g!6ggo @"''V*; +?.0hh$.> 	,,r   c                     UR                  SS5      (       ac  U R                  (       aR  [        R                  R	                  U5      u  p4UR                  SS5      n[        R                  R                  X45      nU$ )NguiFpythonpythonw)getr0   r)   pathr   replacejoin)r3   r   optionsdnfns        r   _get_alternate_executable%ScriptMaker._get_alternate_executableg   sU    ;;ue$$WW]]:.FBHi0Bb-Jr   r    c                      [        U5       nUR                  S5      S:H  sSSS5        $ ! , (       d  f       g= f! [        [        4 a    [        R                  SU5         gf = f)zH
Determine if the specified executable is a script
(contains a #! line)
   z#!NzFailed to open %sF)openreadOSErrorIOErrorloggerwarning)r3   r   fps      r   	_is_shellScriptMaker._is_shellp   sR    
*%771:- &%%W% 2J?s#   < +	< 
9< < &A%$A%c                     U R                  U5      (       a5  SS KnUR                  R                  R	                  S5      S:X  a  U$  SU-  $ UR                  5       R                  S5      (       a  U$ SU-  $ )Nr   zos.nameLinuxz
jython.exez/usr/bin/env %s)rN   r    langSystemgetPropertylowerendswith)r3   r   r    s      r   _fix_jython_executable"ScriptMaker._fix_jython_executable|   sw    ~~j))99##//	:gE%% F
 %z11 !!#,,\::!!$z11r   c                    [         R                  S:w  a  SnOC[        U5      [        U5      -   S-   n[        R                  S:X  a  SnOSnSU;  =(       a    XE:*  nU(       a  SU-   U-   S	-   nU$ S
nUSU-   U-   S-   -  nUS-  nU$ )a  
Build a shebang line. In the simple case (on Windows, or a shebang line
which is not too long or contains spaces) use a simple formulation for
the shebang. Otherwise, use /bin/sh as the executable, with a contrived
shebang which allows the script to run either under Python or sh, using
suitable quoting. Thanks to Harald Nordgren for his input.

See also: http://www.in-ulm.de/~mascheck/various/shebang/#length
          https://hg.mozilla.org/mozilla-central/file/tip/mach
r   T   darwini          s   #!   
s
   #!/bin/sh
s	   '''exec' s    "$0" "$@"
s   ' ''')r)   r*   lenr1   platform)r3   r   post_interpsimple_shebangshebang_lengthmax_shebang_lengthresults          r   _build_shebangScriptMaker._build_shebang   s     77g!N !_s;/??!CN||x'%("%("#:5 I#1#G  Z'+5=F
  $FlZ/+=OOFhFr   c                    SnU R                   (       a  U R                   nSnGOD[        R                  " 5       (       d  [        5       nGO[	        5       (       aL  [
        R                  R                  [        R                  " S5      S[        R                  " S5      -  5      nO[
        R                  S:X  aL  [
        R                  R                  [        R                  " S5      S[        R                  " S5      -  5      nOc[
        R                  R                  [        R                  " S5      S[        R                  " S	5      < [        R                  " S5      < 35      nU(       a  U R                  XS5      n[        R                  R                  S
5      (       a  U R                  U5      nU(       a  [!        U5      nUR#                  S5      n[        R                  S:X  a  SU;  a  SU;  a  US-  nU R%                  XR5      n UR'                  S5        US:w  a   UR'                  U5        U$ U$ ! [(         a    [+        SU-  5      ef = f! [(         a    [+        SU< SU< S35      ef = f)NTFscriptszpython%sEXEr#   BINDIRr:   VERSIONr    utf-8cliz	-X:Framesz-X:FullFramess
    -X:Framesz,The shebang (%r) is not decodable from utf-8zThe shebang (z-) is not decodable from the script encoding ())r   r   is_python_buildr   r   r)   r=   r?   get_pathget_config_varr*   rC   r1   r`   r   rW   r   encoderf   decodeUnicodeDecodeError
ValueError)r3   encodingra   r@   enquoter   shebangs          r   _get_shebangScriptMaker._get_shebang   s   ??JG**,,')JYY""9-Y55e<<>J ww$  WW\\,,X6)":":5"ABD
  WW\\,,X6$-$<$<Y$G$-$<$<U$CEF
 77
LJ<<""6**44Z@J +J7J  &&w/
LLE!k&D#;6=(K%%j>	&NN7# w6x(
 w " 	&K$% & &	& & 6 ")8"5 6 66s   H< 'I <II7c                     U R                   [        UR                  UR                  R	                  S5      S   UR                  S9-  $ )N.r   )moduleimport_namefunc)script_templatedictprefixsuffixr   )r3   entrys     r   _get_script_textScriptMaker._get_script_text   sA    ##d<<**3/2'  	r   c                 ^    [         R                  R                  U5      nU R                  U-  $ N)r)   r=   basenamemanifest)r3   exenamebases      r   get_manifestScriptMaker.get_manifest   s%    ww(}}t##r   c                 *   U R                   =(       a    U R                  n[        R                  R	                  S5      nUR                  U5      (       d  X'-  nU(       d  X#-   nOUS:X  a  U R                  S5      nOU R                  S5      n[        5       n	[        U	S5       n
[        R                  R                  S5      nU(       a>  [        R                  " [        U5      5      S S n[        SUS9nU
R                  X5        OU
R                  SU5        S S S 5        U	R!                  5       nX-   U-   nU GHm  n[        R"                  R%                  U R&                  U5      nU(       a]  [        R"                  R)                  U5      u  nnUR+                  S	5      (       a  UnS
U-  n U R,                  R/                  UU5        OU R                  (       a"  UR                  SU-   5      (       d	  U< SU< 3n[        R"                  R7                  U5      (       a*  U R>                  (       d  [2        R5                  SU5        GM  U R,                  R/                  UU5        U R@                  (       a  U R,                  RC                  U/5        URE                  U5        GMp     g ! , (       d  f       GN= f! [0         a    [2        R5                  S5        SU-  n[        R"                  R7                  U5      (       a  [        R8                  " U5        [        R:                  " UU5        U R,                  R/                  UU5        [2        R=                  S5         [        R8                  " U5         N! [0         a      Nf = ff = f)Nrm   pytwSOURCE_DATE_EPOCH   z__main__.py)filename	date_timez.pyz%s.exez:Failed to write executable - trying to use .deleteme logicz%s.deletemez0Able to replace executable using .deleteme logicr}   zSkipping existing file %s)#r&   r0   r)   lineseprs   rV   _get_launcherr   r   environr<   timegmtimeintr   writestrgetvaluer=   r?   r%   splitextr   r/   write_binary_file	ExceptionrK   rL   existsremoverenamedebugr(   r,   set_executable_modeappend)r3   namesry   script_bytes	filenamesextuse_launcherr   launcherstreamzfsource_date_epochr   zinfozip_datar*   outnamenedfnames                       r   _write_scriptScriptMaker._write_script   s   ))9dkk**##G,((G"1Ld{--c2--c2YF%$&JJNN3F$G!$ $C0A,B CBQ GI#].79EKK4KK|< & (H#-8LDggll4??D9Gww''01<<&&G"W,LL227LI" ;;w'7'7c	(# (#)0#6G77>>'**4<<NN#>H..wE==LL44gY?W%E  &%( ! NN $9 :*W4Fww~~f--		&)IIgv.LL227LILL "3 4		&)$ s8   $A7J/1K/
J>B&N(N  
N
NNN-c                 h   [        5       nSU R                  ;   a  UR                  U5        SU R                  ;   a$  UR                  U< U R                  S   < 35        SU R                  ;   aB  UR                  U< U R                  < U R                  S   < SU R                  S   < 35        U$ )Nr!   Xr   r"   r}   r   )r-   r.   addr2   variant_separator)r3   r*   re   s      r   get_script_filenames ScriptMaker.get_script_filenames9  s    JJt$--JJt'8'8';<=DMM!JJd44d6G6G6J))!,. / r   c                    SnU(       a>  UR                  S/ 5      nU(       a%  SSR                  U5      -  nUR                  S5      nU R                  SXCS9nU R	                  U5      R                  S5      nU R                  UR                  5      nU(       a  UR                  SS5      (       a  S	n	OS
n	U R                  XXrU	5        g )Nr   interpreter_argsz %sr   rm   r@   r9   Fpywr   )r<   r?   rs   rz   r   r   r*   r   )
r3   r   r   r@   ra   argsry   scriptscriptnamesr   s
             r   _make_scriptScriptMaker._make_scriptE  s    ;;126Dsxx~-"kk'2##G[#J&&u-44W=//

;w{{5%00CC;CHr   c                    Sn[         R                  R                  U R                  [	        U5      5      n[         R                  R                  U R
                  [         R                  R                  U5      5      nU R                  (       d7  U R                  R                  X5      (       d  [        R                  SU5        g  [        US5      nUR                  5       nU(       d  [        R                  SU5        g [        R!                  UR#                  SS5      5      nU(       a  SnUR%                  S5      =(       d    S	nU(       dq  U(       a  UR+                  5         U R                  R-                  X5        U R.                  (       a  U R                  R1                  U/5        UR3                  U5        g [        R5                  S
UU R
                  5        U R                  R(                  (       d  [7        UR                  5      u  pUR9                  S5        U R;                  U	W5      nSW;   a  SnOSn[         R                  R                  U5      nU R=                  U/XR?                  5       X,5        U(       a  UR+                  5         g g ! [&         a    U R(                  (       d  e S n GNtf = f)NFznot copying %s (up-to-date)rbz%s is an empty file (skipping)s   
r^   Tr   r   zcopying and adjusting %s -> %sr   s   pythonwr   r   ) r)   r=   r?   r$   r   r%   r   r'   r/   newerrK   r   rG   readlinerL   FIRST_LINE_REmatchr>   grouprJ   r4   close	copy_filer,   r   r   infor   seekrz   r   rH   )r3   r   r   adjustr   f
first_liner   ra   rw   linesry   r   r   s                 r   _copy_scriptScriptMaker._copy_scriptU  s   doo|F/CD'',,t0@0@0HIzz$,,"4"4V"E"ELL6?
	4VT"A J?H!''
(:(:7E(JKE#kk!n3	LL""63}}00';W%KK8&)<<''"1!**"=q	++HkB+CCGG$$W-""A39J	 G  	<<A	s   J J=<J=c                 .    U R                   R                  $ r   r/   r4   )r3   s    r   r4   ScriptMaker.dry_run  s    ||###r   c                 $    XR                   l        g r   r   )r3   values     r   r4   r     s    $r   r#   c                 2   [         R                  " S5      S:X  a  SnOSn[        5       S:X  a  SOSnU< U< U< S3n[        R	                  S	S
5      S   n[        U5      R                  U5      nU(       d  SU< SU< 3n[        U5      eUR                  $ )NP   6432z	win-arm64z-armr!   z.exer}   r   r   zUnable to find resource z in package )	structcalcsizer   __name__rsplitr	   findrv   bytes)r3   kindbitsplatform_suffixr*   distlib_packageresourcemsgs           r   r   ScriptMaker._get_launcher  s    s#q((4+(Ef2O#'?D 'ooc15a8Oo.33D9Ho/ o%>>!r   c                 l    / n[        U5      nUc  U R                  X5        U$ U R                  XCUS9  U$ )a  
Make a script.

:param specification: The specification, which is either a valid export
                      entry specification (to make a script from a
                      callable) or a filename (to make a script by
                      copying from a source location).
:param options: A dictionary of options controlling script generation.
:return: A list of all absolute pathnames written to.
r   )r   r   r   )r3   specificationr@   r   r   s        r   makeScriptMaker.make  sI     	 /=m7  e@r   c                 \    / nU H#  nUR                  U R                  XB5      5        M%     U$ )z
Take a list of specifications and make scripts from them,
:param specifications: A list of specifications.
:return: A list of all absolute pathnames written to,
)extendr   )r3   specificationsr@   r   r   s        r   make_multipleScriptMaker.make_multiple  s0     	+MTYY}>? ,r   )
r/   r0   r&   r(   r'   r,   r$   r%   r.   r2   )TFN)r   Nr   )$r   
__module____qualname____firstlineno____doc__SCRIPT_TEMPLATEr   r   r6   rC   r1   r`   r   rN   rW   rf   rz   r   _DEFAULT_MANIFESTr   r   r   r   r   r   r   propertyr4   setterr)   r*   r+   r   r   r   __static_attributes__ r   r   r   r   I   s     &OJ
  $-* ||v&&
	
	2>FP !H$:&x 
I 1f $ $ ^^% % 
ww$277f,!xx4/	"&&	r   r   )#ior   loggingr)   rer   r1   r   zipfiler   compatr   r   r   	resourcesr	   utilr
   r   r   r   r   r   	getLoggerr   rK   stripr   compiler   r   r   _enquote_executableobjectr   r  r   r   <module>r     s      	 	  
   7 7 : : 
		8	$  uw! & 

=>" ) {& {r   