
    Mi              	          % S 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	J
r
  SSKJr  \(       a  SSKJr  \S   r\S   rS	S
/rSSSSSSSSS.r\\
S   \4   \S'   SrS\S\4S jrS\S\S\4S jr " S S	\5      r " S S
5      rg)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Scriptzt32.exezt64.exez	t_arm.exezt64-arm.exezw32.exezw64.exez	w_arm.exezw64-arm.exe))r   r   )r   r   )r   r   )r   r   )r   r   )r   r   )r   r   )r   r   )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                 6    SU ;   a  g[        U 5      S-   nUS:*  $ )N    F      )len)r   shebang_lengths     k/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/installer/scripts.py_is_executable_simpler   +   s(    z_q(N S      forlauncherc                     U R                  S5      nU(       a  SU-   $ [        U5      (       a  SU-   $ [        R                  " U 5      R                  S5      nSU-   S-   S-   $ )zBuild 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   #!s   #!/bin/sh
'''exec' s    "$0" "$@"
s   ' ''')encoder   shlexquote)r   r!   executable_bytesquoteds       r   _build_shebangr)   5   sl     "((1'''-..''' [[$++G4F"V+o=HHr    c                       \ rS rSrSrSrg)r   N   z=Raised if the user provides incorrect script section or kind. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r,   r    r   r   r   N   s    Gr    c            
           \ rS rSrSrSrS\S\S\SSS	S
4
S jrS	\4S jrSSS	\	\
   4S jrS\SSS	\\\
4   4S jrSrg
)r   R   z7Describes a script based on an entry point declaration.namemoduleattrsectionr6   r7   r8   r9   r   r   Nc                 4    Xl         X l        X0l        X@l        g)a@  Construct 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

Nr5   )selfr6   r7   r8   r9   s        r   __init__Script.__init__W   s     		r    c                 d    SR                  U R                  U R                  U R                  5      $ )Nz(Script(name={!r}, module={!r}, attr={!r})formatr6   r7   r8   )r;   s    r   __repr__Script.__repr__i   s*    9@@IIKKII
 	
r    kindr   c                     US:X  a  g U R                   U4n [        U   n[        [        U5      $ ! [         a"    U< S[        [        5      < 3n[	        U5      ef = f)Nr
   z not in )r9   r   KeyErrorsortedr   r   r   )r;   rB   keyr6   errors        r   _get_launcher_dataScript._get_launcher_datap   sk    7?||T"	'%c*D 8T**  	'gXf-?&@%CDE&&	's	   	0 ,Ar   c                 $   U R                  U5      n[        U[        U5      S9n[        R	                  U R
                  U R                  R                  S5      S   U R                  S9R                  S5      nUc  U R                  US-   U-   4$ [        R                  " 5       n[        R                  " US5       nUR                  S	U5        SSS5        U R                   S
3nX4-   S-   UR                  5       -   n	X4$ ! , (       d  f       N8= f)ao  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   )r7   import_name	func_pathr#   N   
wz__main__.pyz.exe)rH   r)   bool_SCRIPT_TEMPLATEr?   r7   r8   splitr$   r6   ioBytesIOzipfileZipFilewritestrgetvalue)
r;   r   rB   launchershebangcodestreamzfr6   datas
             r   generateScript.generate{   s     **40 hH&&;;		,Q/ii ' 
 &/	 	 IIw566__VS)RKKt, *))D!!E)FOO,==|	 *)s   <D
D)r8   r7   r6   r9   )r-   r.   r/   r0   r1   	__slots__strr<   r@   r   bytesrH   r   r_   r2   r,   r    r   r   r   R   s}    A5I!$,/:I	$
# 
	+~ 	+(5/ 	+3 n sEzAR r    )r1   rS   r%   rU   importlib.resourcesr   typingr   r   r   r   	installerr   r	   r   r   __all__r   rb   __annotations__rQ   rc   rP   r   r)   
ValueErrorr   r   r,   r    r   <module>rj      s    8 	   + : : STL,-M H
% '''+"##'	L GE"ABCGH 	 !e ! !Is I I% I2HJ HE Er    