
    'jI                     z   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  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Jr  \R4                  " \5      rS	R;                  5       r\R>                  " S
5      r Sr!\RD                  S:X  d   \RD                  S:X  a  \RF                  S:X  at  \RI                  SS5      S    r%\" \%5      RM                  S5       V s0 s H<  n U RD                  RO                  S5      (       d  M%  U RD                  U RP                  _M>     sn r)S r*\*r+ " S S\,5      r-gs  sn f )    )BytesION)ZipInfo   )DistlibException)	sysconfigdetect_encodingZipFile)finder)FileOperatorget_export_entryconvert_pathget_executableget_platformin_venvis_in_directorya  
<?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
if __name__ == '__main__':
    from %(module)s import %(import_name)s
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(%(func)s())
ntjava. .exec                     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      S/var/www/html/KUNJ/venv/lib/python3.13/site-packages/pip/_vendor/distlib/scripts.pyenquote_executabler    I   s    
j
   11)//Q7Ck!+*@*@*E*E*-{;
  ((--#j0
    c                   j   \ 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)ScriptMaker]   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posixr   )r   X.Yr   )
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__f   s    $$*
G+[F1B1ZrxxSZGZK(6g!6ggoQ"''V*;*PD@P,,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)getr4   r-   pathr   replacejoin)r7   r   optionsdnfns        r   _get_alternate_executable%ScriptMaker._get_alternate_executablet   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)r7   r   fps      r   	_is_shellScriptMaker._is_shell}   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)rR   r   langSystemgetPropertylowerendswith)r7   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O\[        [        SS5      (       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cross_compilingF   darwini          s   #!   
s
   #!/bin/sh
s	   '''exec' s    "$0" "$@"
s   ' '''
)r-   r.   getattrr5   lenplatform)r7   r   post_interpsimple_shebangshebang_lengthmax_shebang_lengthresults          r   _build_shebangScriptMaker._build_shebang   s     77g!NS+U33
 #N !_s;/??!CN||x'%("%("#:5aN<`NZ'+5=F
  $FlZ/+=OOFj 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-   rA   rC   get_pathget_config_varr.   rG   r5   rf   r   r[   r    encoderl   decodeUnicodeDecodeError
ValueError)r7   encodingrg   rD   enquoter   shebangs          r   _get_shebangScriptMaker._get_shebang   s   ??JG**,,')JYYi&8&8&CZR[RjRjkpRqEqrJww$  WW\\)*B*B8*L*4	8P8PQV8W*XZ
  WW\\,,X6$-$<$<Y$GIaIabgIhik
 77
LJ<<""6**44Z@J +J7J  &&w/
LLE!k&D{2=(K%%j>	WNN7# wXx( w " 	WKgUVV	W & X DKX"W X XXs   H< 'I <II7c                     U R                   [        UR                  UR                  R	                  S5      S   UR                  S9-  $ )Nr   r   )moduleimport_namefunc)script_templatedictprefixsuffixr   )r7   entrys     r   _get_script_textScriptMaker._get_script_text   sB    ##d<<U\\-?-?-DQ-Gell'\ \ 	\r!   c                 ^    [         R                  R                  U5      nU R                  U-  $ N)r-   rA   basenamemanifest)r7   exenamebases      r   get_manifestScriptMaker.get_manifest  s%    ww(}}t##r!   c                 6   U R                   =(       a    U R                  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Xr-   U-   nU GH  n[
        R                  R                  [
        R                  R!                  U R"                  U5      5      n[%        XR"                  5      (       d  ['        S5      eU(       a\  [
        R                  R)                  U5      u  nnUR+                  S	5      (       a  UnS
U-  n U R,                  R/                  X5        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MT  U R,                  R/                  X5        U RB                  (       a  U R,                  RE                  U/5        URG                  U5        GM     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/                  X5        [2        R=                  S5         [
        R8                  " U5         N! [0         a      Nf = ff = f)NpytwSOURCE_DATE_EPOCH   z__main__.py)filename	date_timez"Attempt to escape script directoryz.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*   r4   _get_launcherr   r	   r-   environr@   timegmtimeintr   writestrgetvaluerA   abspathrC   r)   r   r   splitextr   r3   write_binary_file	ExceptionrO   rP   existsremoverenamedebugrZ   r,   r0   set_executable_modeappend)r7   namesr   script_bytes	filenamesextuse_launcherlauncherstreamzfsource_date_epochr   zinfozip_datar.   outnamenedfnames                      r   _write_scriptScriptMaker._write_script  s   ))9dkk"1Ld{--c2--c2YF%$&JJNN3F$G!$ $C0A,B CBQ GI#]iPEKK4KK|< & (H#-8LDggoobggll4??D&IJG"7OO<<&'KLLww''01<<&&G"W,LL227I" ;;w'7'7c	'B'B)0#6G77>>'**4<<NN#>H..wE==LL44gY?W%G  &%* ! NN $9 :*W4Fww~~f--		&)IIgv.LL227ILL "3 4		&)$ s8   +A7J6:K6
K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   )r1   r2   addr6   variant_separator)r7   r.   rk   s      r   get_script_filenames ScriptMaker.get_script_filenames@  s    JJt$--JJt'8'8';<=DMM!JJdD,B,BDDUDUVWDXZ^ZkZklmZnop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   rs   rD   r=   Fpywr   )r@   rC   ry   r   r   r   r.   r   )
r7   r   r   rD   rg   argsr   scriptscriptnamesr   s
             r   _make_scriptScriptMaker._make_scriptJ  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
X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Nsf = f)NFznot copying %s (up-to-date)rbz%s is an empty file (skipping)s   
rc   Tr   r!   zcopying and adjusting %s -> %sr   s   pythonwr   r   ) r-   rA   rC   r(   r   r)   r   r+   r3   newerrO   r   rK   readlinerP   FIRST_LINE_REmatchrB   grouprN   r8   close	copy_filer0   r   r   infor   seekr   r   rL   )r7   r   r   adjustr   f
first_liner   rg   r}   linesr   r   r   s                 r   _copy_scriptScriptMaker._copy_scriptZ  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&//R<<''"1!**"=q	++HkB+CCGG$$W-""A39J	 E  	<<A	s   J J<;J<c                 .    U R                   R                  $ r   r3   r8   )r7   s    r   r8   ScriptMaker.dry_run  s    ||###r!   c                 $    XR                   l        g r   r   )r7   values     r   r8   r     s    $r!   r   c                     [         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U[        ;  a  S	U< S
[        < 3n[        U5      e[        U   $ )NP   6432z	win-arm64z-armr   r   zUnable to find resource z in package )structcalcsizer   WRAPPERSDISTLIB_PACKAGEr|   )r7   kindbitsplatform_suffixr.   msgs         r   r   ScriptMaker._get_launcher  sa    s#q((4+(Ef2O#'?D8#o/ o%D>!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   )r7   specificationrD   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   )r7   specificationsrD   r   r   s        r   make_multipleScriptMaker.make_multiple  s0     	+MTYY}>? ,r!   )
r3   r4   r*   r,   r+   r0   r(   r)   r2   r6   )TFN)r!   Nr   )$__name__
__module____qualname____firstlineno____doc__SCRIPT_TEMPLATEr   r   r:   rG   r5   rf   r   rR   r[   rl   r   r   _DEFAULT_MANIFESTr   r   r   r   r   r   r   propertyr8   setterr-   r.   r/   r   r   r   __static_attributes__ r!   r   r#   r#   ]   s     &OJ- ||v&&
	
	2"H@D\ !H$7&r I 0d $ $ ^^% % 
ww$277f,T1A	"&	r!   r#   ).ior   loggingr-   rer   r5   r   zipfiler   r   r   compatr   r   r	   	resourcesr
   utilr   r   r   r   r   r   r   	getLoggerr   rO   stripr  compiler   r  r.   r/   rsplitr   iteratorrZ   bytesr   r    _enquote_executableobjectr#   )rs   0r   <module>r     s     	 	  
    7 7 $ $ $ 
		8	$  uw! & 

=>" 77d?rww&(RXX-= ooc1-a0O (11"55A66??6" 	5H" ) f& f7s   !$D8	D8