zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
U
W±d¿ã@sàdZddlmZddlZddlZddlZddlZddlmZddl    m
Z
ddl    m Z ddl    m Z e  e¡ZGdd    „d    ejƒZd
d „Zd d „Zdd„ZGdd„dejƒZddœdd„Zddddœdd„Zdd„ZedkrÜeƒdS)z-
Main command-line interface to PyInstaller.
é)Ú annotationsN)Ú defaultdict)Ú __version__)Úlog)ÚcompatcseZdZ‡fdd„Z‡ZS)Ú_SmartFormattercs,| d¡r|dd… ¡Stƒ ||¡SdS)NzR|é)Ú
startswithÚ
splitlinesÚsuperÚ _split_lines)ÚselfÚtextÚwidth©Ú    __class__©úKd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PyInstaller/__main__.pyr $s
z_SmartFormatter._split_lines)Ú__name__Ú
__module__Ú __qualname__r Ú __classcell__rrrrr#srcKsd|ddd…}g}|d<|D]}| | tj¡¡q ddl}|jjj|f|Ž}t     d|¡|S)NÚpathexrzwrote %s)
ÚextendÚsplitÚosÚpathsepÚPyInstaller.building.makespecÚbuildingÚmakespecÚmainÚloggerÚinfo)Ú    filenamesÚoptsZ    temppathsrÚpÚ PyInstallerÚ    spec_filerrrÚ run_makespec-s r(cKs ddl}|jjj||f|ŽdS)Nr)ÚPyInstaller.building.build_mainrÚ
build_mainr )Ú
pyi_configr'Úkwargsr&rrrÚ    run_build;sr-cCs|jdddtdddS)Nz-vz    --versionÚversionz#Show program version info and exit.)Úactionr.Úhelp)Ú add_argumentr)ÚparserrrrÚ __add_options@sûr3csJeZdZ‡fdd„Zddddœdd„Zd    d
„Zdd ddd œd d„Z‡ZS)Ú_PyiArgumentParsercsttƒ|_tƒj||ŽdS)N)rÚlistÚ_pyi_action_groupsr Ú__init__)r Úargsr,rrrr7Ks
z_PyiArgumentParser.__init__ÚÚcallableÚstr)Ú_PyiArgumentParser__add_optionsÚnamecCs@tt|dgƒƒ}||ƒt|dgƒ|d…}|j| |¡dS)ze
        Mutate self with the given callable, storing any new actions added in a named group
        Z_actionsN)ÚlenÚgetattrr6r)r r<r=Zn_actions_beforeZ new_actionsrrrÚ _add_optionsOsz_PyiArgumentParser._add_optionscCs.dd„|jDƒ}|r d |¡}n
|jd}|S)z½
        Get the option name(s) associated with an action
 
        For options that define both short and long names, this function will
        return the long names joined by "/"
        cSsg|]}| d¡r|‘qS)z--)r    )Ú.0r=rrrÚ
<listcomp>_s
z3_PyiArgumentParser._option_name.<locals>.<listcomp>ú/r)Úoption_stringsÚjoin)r r/Z    longnamesr=rrrÚ _option_nameXs
 
z_PyiArgumentParser._option_namezargparse.Namespace)r8ÚgroupÚerrmsgc
Cs ttƒ}|j|D]P}|j}| |¡}t||ƒ| |¡k    r||krR||d7<|||7<q|rœd}| | ¡¡}    |r†d|}t    d|›|    ›|›ƒ‚dS)z(Forbid options from a named action grouprCz
  Ú
zoption(s) not allowed:N)
rr;r6ÚdestrFr?Z get_defaultrEÚvaluesÚ
SystemExit)
r r8rGrHÚoptionsr/rJr=ÚsepÚbadrrrÚ_forbid_optionsfs
z"_PyiArgumentParser._forbid_options)r9)r9)rrrr7r@rFrPrrrrrr4Js     r4)ÚreturncCs‚ddl}ddl}ddl}ttd}d|_| t¡|j|jj    jdd|j|jj
jdd|j|j jdd|j d    d
d d d |S)z>
    Build an argparse parser for PyInstaller's main CLI.
    rN)Zformatter_classZ pyinstallerr)r=r*rr#Z
scriptnameú+zŠName of scriptfiles to be processed or exactly one .spec file. If a .spec file is specified, most options are unnecessary and are ignored.)ÚmetavarÚnargsr0) r)rÚPyInstaller.logr4rÚprogr@r3rrr*rr1)r&r2rrrÚgenerate_parser{s 
 
ürWz list | Nonez dict | None)Úpyi_argsr+cCst ¡ddl}zªtƒ}| |¡}|j ||¡t dt    ¡t dt
  ¡tj rTdnd¡t dt
 
¡¡|j d d¡r˜|j|d    d
d |j d}ntft|ƒŽ}t||ft|ƒŽWnBtk
rÖtd ƒ‚Yn(tk
rüdd lm}| ¡YnXdS)z§
    pyi_args     allows running PyInstaller programmatically without a subprocess
    pyi_config   allows checking configuration once when running multiple tests
    rNzPyInstaller: %sz Python: %s%sz (conda)r9z Platform: %sz.specrz5makespec options not valid when a .spec file is given)rGrHzAborted by user request.)Ú_recursion_too_deep_message)rÚcheck_requirementsrUrWÚ
parse_argsrZ__process_optionsr!r"rÚplatformÚpython_versionZis_condar#ÚendswithrPr(Úvarsr-ÚKeyboardInterruptrLÚRecursionErrorr&rYZraise_with_msg)rXr+r&r2r8r'rYrrrÚrun—s.
ÿ   rbcCs,tj tjd¡dkr"tj d¡tƒdS)Nr)ÚbinZScripts)rÚpathÚbasenameÚsysÚpoprbrrrrÚ_console_script_run½s rhÚ__main__)NN)Ú__doc__Ú
__future__rÚargparserr\rfÚ collectionsrr&rrÚloggingrÚ    getLoggerrr!Ú HelpFormatterrr(r-r3ÚArgumentParserr4rWrbrhrrrrÚ<module> s(     
 
 
1&