zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
U
W±då~ã)@sJdZddlZddlZddlZddlmZmZddlmZddl    m
Z
m Z m Z m Z mZmZmZddlmZmZmZe e¡ZejZddd    gZd
gZd d „Zd d„ZedffZdd„Zefdd„Z dd„Z!Gdd„dƒZ"Gdd„dƒZ#dd„Z$dddggddddgddddggdddgdggdggddddgggggdgddddf)dd„Z%dS) zI
Automatically build spec files containing a description of the project.
éN)ÚDEFAULT_SPECPATHÚHOMEPATH)Úlog)ÚbundleexetmpltÚ bundletmpltÚcipher_absent_templateÚcipher_init_templateÚ onedirtmpltÚ onefiletmpltÚ
splashtmpl)Ú expand_pathÚ    is_darwinÚis_winÚimportsÚ
bootloaderÚ    noarchiveÚallcCstj |¡ dd¡S)Nú\z\\)ÚosÚpathÚnormpathÚreplace)r©rúTd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PyInstaller/building/makespec.pyÚescape_win_filepath#srcCs4tj |¡r|Stj |¡}tjj||d}|SdS)zœ
    Make the filename relative to the directory containing .spec file if filename is relative and not absolute.
    Otherwise keep filename untouched.
    )ÚstartN)rrÚisabsÚabspathÚrelpath)ÚfilenameZspec_dirrrrÚmake_path_spec_relative(s
  r rc
Csbz| t¡\}}Wn4tk
rF}zt d t¡¡|‚W5d}~XYnX|rP|sZt d¡‚||fS)Nz!Wrong syntax, should be SRC{}DESTz%You have to specify both SRC and DEST)ÚsplitÚadd_command_sepÚ
ValueErrorÚargparseÚ ArgumentErrorÚformat)ÚstringÚsrcÚdestÚerrrÚadd_data_or_binary<s$
r+c    Cs®tj |¡sd|fS|D]Œ\}}tj |¡|ks<td|ƒ‚ztj ||g¡}Wntk
rhd}YnX||kr|t|ƒd…}| d¡r˜|dd…}||fSqd|fS)Nz$path '%s' should already be absolute)rú/é)    rrrrÚAssertionErrorÚ
commonpathr#ÚlenÚ
startswith)rZ conversionsÚ    from_pathZto_nameZ common_pathÚrestrrrÚmake_variable_pathIs  
 
 r4cCst tjd¡|S)NzÓBytecode encryption will be removed in PyInstaller v6. Please remove your --key=xxx argument to avoid breakages on upgrade. For the rationale/alternatives see https://github.com/pyinstaller/pyinstaller/pull/6999)ÚloggerrÚloggingZ DEPRECATION)ÚxrrrÚdeprecated_key_option^s
þr8c@seZdZdd„Zdd„ZdS)ÚPathcGstjj|Ž|_d|_|_dS)N)rrÚjoinÚvariable_prefixÚfilename_suffix)ÚselfÚpartsrrrÚ__init__jsz Path.__init__cCsL|jdkrt|jƒ\|_|_|jdkr0t|jƒSd|jdt|jƒdS)Nz os.path.join(ú,ú))r<r4rr;Úrepr)r=rrrÚ__repr__ns
 
 
 
z Path.__repr__N)Ú__name__Ú
__module__Ú __qualname__r?rCrrrrr9isr9c@sTeZdZdd„Zdd„Zdd„Zdd„Zd    d
„Zd d „Zd d„Z    dd„Z
dd„Z dS)ÚPreamblec
Csš|pg|_|pg|_|pg|_g|_|r2| d¡|r@| d¡|rN| d¡|r\| d¡|sd|    rn| d¡|jr„|jdg7_|s”|s”|s”|    r¨| d|j¡d|_|s°|rÄ| d|j¡d|_|sÌ|rà| d    |j¡d    |_|D]}
| |
¡qä|D]}
| |
¡qø|    D]}
| |
¡q |D]}
|     |
¡q"|D]}
|
¡q8|D]}
|  |
¡qN|jrˆ|jd
dkrˆ|jdg7_d   |j¡|_dS) NZcollect_data_filesZcollect_dynamic_libsÚcollect_submodulesÚ collect_allÚ copy_metadataÚÚdatasÚbinariesÚ hiddenimportséÿÿÿÿÚ
) rMrNrLÚcontentÚ_add_hookutil_importÚ_add_varÚ_add_collect_dataÚ_add_copy_metadataÚ_add_recursive_copy_metadataÚ_add_collect_binariesÚ_add_collect_submodulesÚ_add_collect_allr:) r=rLrMrNÚ collect_dataÚcollect_binariesrHrIrJÚrecursive_copy_metadataÚentryrrrr?ysP
 
 
 
 
 
 
 
  zPreamble.__init__cCs|jd |¡g7_dS)Nz'from PyInstaller.utils.hooks import {0}©rQr&©r=ÚnamerrrrR²szPreamble._add_hookutil_importcCs|jd ||¡g7_dS)Nz    {0} = {1}r^)r=r`Ú initial_valuerrrrSµszPreamble._add_varcCs|jd |¡g7_dS)Nz"datas += collect_data_files('{0}')r^r_rrrrT¸szPreamble._add_collect_datacCs|jd |¡g7_dS)Nzdatas += copy_metadata('{0}')r^r_rrrrU»szPreamble._add_copy_metadatacCs|jd |¡g7_dS)Nz-datas += copy_metadata('{0}', recursive=True)r^r_rrrrV¾sz%Preamble._add_recursive_copy_metadatacCs|jd |¡g7_dS)Nz'binaries += collect_dynamic_libs('{0}')r^r_rrrrWÁszPreamble._add_collect_binariescCs|jd |¡g7_dS)Nz*hiddenimports += collect_submodules('{0}')r^r_rrrrXÄsz Preamble._add_collect_submodulescCs|jd |¡dg7_dS)Nztmp_ret = collect_all('{0}')zHdatas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]r^r_rrrrYÇsþzPreamble._add_collect_allN) rDrErFr?rRrSrTrUrVrWrXrYrrrrrGxs9rGc
CsÖ| d¡}|jddddddd|jd    d
dd dd d|jd ddd|jdddd| d¡}|jddgtdddd|jddgtdddd|jdd d!ddgd"ttjƒd#|jd$d%dgd&d'd(d)|jd*dgd&d+d,d)|jd-d.dgd&d/d0d)|jd1dgd&d2d3d)|jd4dgd&d5d6d)|jd7dgd8d9d:d)|jd;dgd8d<d=d)|jd>dd?gd@dA|jdBddCgdDdA|jdEdFdgdGd|jdHdItjtdJ|jdKdLdMdNdO| dP¡}|jdQdRgdt    t
ddSdT|jdUdVdWdgdXd#|jdYdZd d[d\|jd]d d^d_d`|jdadbdcdddde| df¡}|jdgdhdidjd ddkd|jdldmdndjdddod|jdpdqddrdsdtdu|jdvdwd d^dxd| dy¡}|jdzd{dcd|dO|jd}d~dd€d|jdd‚ddƒd„|jd…d†d‡dˆdgd‰d#|jdŠd‹d d^dŒd|jddŽd d^dd| d¡}|jd‘d’d d“d„|jd”d•d d–d„| d—¡}|jd˜d™d d^dšd|jd›dœddž|jdŸd d¡d¢dd£d¤|jd¥d¦d§dd¨d¤|jd©dªd«dd¬d¤| d­¡}|jd®d¯d°d±dO|jd²d d^d³d`dS)´zS
    Add the `Makespec` options to a option-parser instance or a option group.
    zWhat to generatez-Dz--onedirÚonefileÚ store_falseNz=Create a one-folder bundle containing an executable (default))r)ÚactionÚdefaultÚhelpz-Fz    --onefileÚ
store_truez%Create a one-file bundled executable.z
--specpathZDIRzDFolder to store the generated spec file (default: current directory))Úmetavarrfz-nz--namezRName to assign to the bundled app and spec file (default: first script's basename))rfzWhat to bundle, where to searchz
--add-dataÚappendz<SRC;DEST or SRC:DEST>rLzêAdditional non-binary files or folders to be added to the executable. The path separator  is platform specific, ``os.pathsep`` (which is ``;`` on Windows and ``:`` on most unix systems) is used. This option can be used multiple times.)rdreÚtyperhr)rfz --add-binaryrMzŽAdditional binary files to be added to the executable. See the ``--add-data`` option for more details. This option can be used multiple times.z-pz--pathsÚpathexzËA path to search for imports (like using PYTHONPATH). Multiple paths are allowed, separated by ``%s``, or use this option multiple times. Equivalent to supplying the ``pathex`` argument in the spec file.)r)rhrdrerfz--hidden-importz--hiddenimportZ
MODULENAMErNz`Name an import not visible in the code of the script(s). This option can be used multiple times.)rdrerhr)rfz--collect-submodulesrHzdCollect all submodules from the specified package or module. This option can be used multiple times.z--collect-dataz--collect-datasrZz^Collect all data from the specified package or module. This option can be used multiple times.z--collect-binariesr[zbCollect all binaries from the specified package or module. This option can be used multiple times.z --collect-allrIz~Collect all submodules, data files, and binaries from the specified package or module. This option can be used multiple times.z--copy-metadataZ PACKAGENAMErJzPCopy metadata for the specified package. This option can be used multiple times.z--recursive-copy-metadatar\ziCopy metadata for the specified package and all its dependencies. This option can be used multiple times.z--additional-hooks-dirÚ    hookspathzOAn additional path to search for hooks. This option can be used multiple times.)rdr)rerfz--runtime-hookÚ runtime_hookszíPath to a custom runtime hook file. A runtime hook is code that is bundled with the executable and is executed before any other code or module to set up special features of the runtime environment. This option can be used multiple times.z--exclude-moduleÚexcludeszšOptional module or package (the Python name, not the path name) that will be ignored (as though it was not found). This option can be used multiple times.z--keyÚkey)r)rfrjz--splashÚsplashZ
IMAGE_FILEz‘(EXPERIMENTAL) Add an splash screen with the image IMAGE_FILE to the application. The splash screen can display progress updates while unpacking.)r)rhrfzHow to generatez-dz--debuga#R|Provide assistance with debugging a frozen
application. This argument may be provided multiple
times to select several of the following options.
 
- all: All three of the following options.
 
- imports: specify the -v option to the underlying
  Python interpreter, causing it to print a message
  each time a module is initialized, showing the
  place (filename or built-in module) from which it
  is loaded. See
  https://docs.python.org/3/using/cmdline.html#id4.
 
- bootloader: tell the bootloader to issue progress
  messages while initializing and starting the
  bundled app. Used to diagnose problems with
  missing imports.
 
- noarchive: instead of storing all frozen Python
  source files as an archive inside the resulting
  executable, store them as files in the resulting
  output directory.
 
)reÚnargsÚchoicesrdrfz--python-optionÚpython_optionsZ PYTHON_OPTIONz¥Specify a command-line option to pass to the Python interpreter at runtime. Currently supports "v" (equivalent to "--debug imports"), "u", and "W <warning control>".z-sz--stripzZApply a symbol-table strip to the executable and shared libs (not recommended for Windows))rdrfz--noupxFzSDo not use UPX even if it is available (works differently between Windows and *nix))rdrerfz --upx-excludeÚ upx_excludeÚFILEzÛPrevent a binary from being compressed when using upx. This is typically used if upx corrupts certain binaries during compression. FILE is the filename of the binary without path. This option can be used multiple times.)r)rhrdrfz%Windows and Mac OS X specific optionsz-cz    --consolez --nowindowedÚconsolez|Open a console window for standard i/o (default). On Windows this option has no effect if the first script is a '.pyw' file.z-wz
--windowedz --noconsolezýWindows and Mac OS X: do not provide a console window for standard i/o. On Mac OS this also triggers building a Mac OS .app bundle. On Windows this option is automatically set if the first script is a '.pyw' file. This option is ignored on *NIX systems.z-iz--iconÚ    icon_filez9<FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE">aøFILE.ico: apply the icon to a Windows executable. FILE.exe,ID: extract the icon with ID from an exe. FILE.icns: apply the icon to the .app bundle on Mac OS. If an image file is entered that isn't in the platform format (ico on Windows, icns on Mac), PyInstaller tries to use Pillow to translate the icon into the correct format (if Pillow is installed). Use "NONE" to not apply any icon, thereby making the OS show some default (default: apply PyInstaller's icon). This option can be used multiple times.)rdr)rhrfz--disable-windowed-tracebackÚdisable_windowed_tracebackz¡Disable traceback dump of unhandled exception in windowed (noconsole) mode (Windows and macOS only), and instead display a message that this feature is disabled.zWindows specific optionsz--version-fileÚ version_filez,Add a version resource from FILE to the exe.z-mz
--manifestz <FILE or XML>z$Add manifest FILE or XML to the exe.z--no-embed-manifestÚembed_manifestzÄGenerate an external .exe.manifest file instead of embedding the manifest into the exe. Applicable only to onedir mode; in onefile mode, the manifest is always embedded, regardless of this option.)r)rdrfz-rz
--resourceÚ    resourcesZRESOURCEaAdd or update a resource to a Windows executable. The RESOURCE is one to four items, FILE[,TYPE[,NAME[,LANGUAGE]]]. FILE can be a data file or an exe/dll. For data files, at least TYPE and NAME must be specified. LANGUAGE defaults to 0 or may be specified as wildcard * to update all resources of the given TYPE and NAME. For exe/dll files, all resources from FILE will be added/updated to the final executable if TYPE, NAME and LANGUAGE are omitted or specified as wildcard *. This option can be used multiple times.z --uac-adminÚ    uac_adminzXUsing this option creates a Manifest that will request elevation upon application start.z--uac-uiaccessÚ uac_uiaccesszMUsing this option allows an elevated application to work with Remote Desktop.z:Windows Side-by-side Assembly searching options (advanced)z--win-private-assembliesÚwin_private_assemblieszùAny Shared Assemblies bundled into the application will be changed into Private Assemblies. This means the exact versions of these assemblies will always be used, and any newer versions installed on user machines at the system level will be ignored.z--win-no-prefer-redirectsÚwin_no_prefer_redirectszÛWhile searching for Shared or Private Assemblies to bundle into the application, PyInstaller will prefer not to follow policies that redirect to newer versions, and will try to bundle the exact versions of the assembly.zMac OS specific optionsz--argv-emulationÚargv_emulationz·Enable argv emulation for macOS app bundles. If enabled, the initial open document/URL event is processed by the bootloader and the passed file paths or URLs are appended to sys.argv.z--osx-bundle-identifierÚbundle_identifierzóMac OS .app bundle identifier is used as the default unique program name for code signing purposes. The usual form is a hierarchical name in reverse DNS notation. For example: com.mycompany.department.appname (default: first script's basename))r)rfz--target-architecturez --target-archÚ target_archZARCHa9Target architecture (macOS only; valid values: x86_64, arm64, universal2). Enables switching between universal2 and single-arch version of frozen application (provided python installation supports the target architecture). If not target architecture is not specified, the current running architecture is targeted.)r)rhrerfz--codesign-identityÚcodesign_identityZIDENTITYz¼Code signing identity (macOS only). Use the provided identity to sign collected binaries and generated executable. If signing identity is not provided, ad-hoc signing is performed instead.z--osx-entitlements-fileÚentitlements_fileZFILENAMEzOEntitlements file to use when code-signing the collected binaries (macOS only).zRarely used special optionsz--runtime-tmpdirÚruntime_tmpdirÚPATHaWhere to extract libraries and support files in `onefile`-mode. If this option is given, the bootloader will ignore any temp-folder location defined by the run-time OS. The ``_MEIxxxxxx``-folder will be created here. Please use this option only if you know what you are doing.z--bootloader-ignore-signalszþTell the bootloader to ignore signals rather than forwarding them to the child process. Useful in situations where for example a supervisor process signals both the bootloader and the child (e.g., via a process group) to avoid signalling the child twice.) Úadd_argument_groupÚ add_argumentr+rBrÚpathsepr$ZSUPPRESSr8ÚDEBUG_ALL_CHOICEÚDEBUG_ARGUMENT_CHOICES)ÚparserÚgrrrÚ __add_optionsÎs„
úúýý
ù ù
þù ù    úù    úú    úú    ûû    ûüü
ò'ú    üüû
 
ù
ù ú û    
üüüù ûû
üü    
û    ýú û    û
üürŽFTc*6" s”|dkr d}|dkrd}|dkr<tj tj |d¡¡d}ˆdkrJt‰ntˆƒ‰ˆtkrhtj t|¡‰tj ˆ¡s~t     ˆ¡d}+| r–|+dt
| ƒ7}+|r¢|+d7}+|r®|+d7}+|rò|ddkrÈ|+d    7}+n|+d
d  d d „|Dƒ¡7}+d|d}nd}|rd|}|r:d|kr*|+d|  dd¡7}+n|+dt
|ƒ7}+|sH|+d7}+|rlt t t
|ƒƒ}|+dt|ƒ7}+|ptg}|p~g}tr¤tj |d¡ddkr¤d}‡fdd„|Dƒ}t t t|ƒƒ}|rz ddl},Wn*tk
rt d¡t d¡YnXtd|i}-nt}-|dkr"g}td|kr4t}t||||!| ||"|#|%ƒ    }.|$rhtd|$i}/d}0d}1n d}/}0}1d |kr’d!|kr’| d!¡d"d„|Dƒ}2||
pªg|.j|.j|.j |.j!|d#|k|2d$|k| || ||    |+|-||päg|pìg|||||)|&|'|(|||/|1|0d%œ!}3tj ˆ|d&¡}4t"|4d'd(d)^}5|r^|5 #t$|3¡t%r†|s†|5 #t&|3¡n(|5 #t'|3¡t%r†|s†|5 #t(|3¡W5QRX|4S)*NFTrrKz
    version='%s',z
    uac_admin=True,z
    uac_uiaccess=True,ÚNONEz
    icon='NONE',z
    icon=[%s],r@css|]}dt|ƒVqdS)ú'%s'N)r)Ú.0ZicrrrÚ    <genexpr>¹szmain.<locals>.<genexpr>rÚNoneú<z
    manifest='%s',ú'z\'z
    embed_manifest=False,z
    resources=%s,rOz.pywcsg|]}t|ˆƒ‘qSr)r )r‘r7©ÚspecpathrrÚ
<listcomp>Ûszmain.<locals>.<listcomp>z„We need tinyaes to use byte-code obfuscation but we could not find it. You can install it with pip by running:
  pip install tinyaesr-roZ splash_imagez
    splash.binaries,z
    splash,rÚvcSsg|]}|ddf‘qS)NZOPTIONr)r‘Úoptrrrr˜srr)!ÚscriptsrkrMrLrNÚpreambler`rÚoptionsZdebug_bootloaderÚbootloader_ignore_signalsÚstripZupxrtr…Ú exe_optionsÚ cipher_initrlrmrnrvrxZiconrr€r‚rƒr„rr~Ú splash_initÚ splash_targetÚsplash_binariesz.specÚwzutf-8)Úencoding))rrÚsplitextÚbasenamerr rr:ÚexistsÚmakedirsrrÚlistÚmaprBrr9ÚtinyaesÚ ImportErrorr5ÚerrorÚsysÚexitrrrŠr‹rGr rirMrLrNrQÚopenÚwriter
r rr    r)6r›r`rbrvÚdebugrsrŸZnoupxrtr…rkryr—ržrxrLrMrwÚmanifestrzr{rrNrlrormrnr|r}rr~rHr[rZrIrJrpr\r‚rƒr„r€Ú_kwargsr r­r¡rœr¢r¤r£Zpython_options_arrayÚdZspecfnmZspecfilerr–rÚmainfsð. 
 
 
 
 
  ÿ
þ  
Ó1  r¸)&Ú__doc__r$rr°Z PyInstallerrrrr6ZPyInstaller.building.templatesrrrrr    r
r ZPyInstaller.compatr r rÚ    getLoggerrDr5r‰r"r‹rŠrr Zpath_conversionsr+r4r8r9rGrŽr¸rrrrÚ<module> s‚ $
 
 
  VÖ