;i(dZddlZddlZddlZddlZddlmZmZddlmZ ddl m Z m Z m Z mZmZddlmZmZe jeZgdZdgZd Zd Zed ffZGd d ejZefdZdZGddejZGddeZ GddeZ!GddeZ"GddZ#GddZ$dZ%dddggdddddgddddggddgdggggddgggggdgddddddf(dZ&dS) zI Automatically build spec files containing a description of the project. N)DEFAULT_SPECPATHHOMEPATH)log)bundleexetmplt bundletmplt onedirtmplt onefiletmplt splashtmpl) is_darwinis_win)imports bootloader noarchiveallchtj|ddS)N\z\\)ospathnormpathreplace)rs QC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\PyInstaller/building/makespec.pyescape_win_filepathr!s( 7  D ! ! ) )$ 7 77ctj|r|Stj|}tj||}|S)z Make the filename relative to the directory containing .spec file if filename is relative and not absolute. Otherwise keep filename untouched. )start)rrisabsabspathrelpath)filenamespec_dirs rmake_path_spec_relativer!&sN  w}}X7??8,,7??88?<<rrc2eZdZdZdddfd ZddZxZS)SourceDestActionzG A command line option which takes multiple source:dest pairs. Ndefaultmetavarc@tj|gdd|dS)Nz SOURCE:DESTr$)super__init__)selfr%r&argskwargs __class__s rr)zSourceDestAction.__init__>s,$MLLVLLLLLrc& dtjdtjd|D\}n2#t$r%t j|d|jddwxYw|d|}|| d}|r|st j|dt||j |j urt||j gt||j ||fdS)Nc3*K|]}|d |VdS)N).0ms r z,SourceDestAction.__call__..Ds.ee`abc`de!eeeeeerz(^\w:[/\\])|[:]zWrong syntax, should be rz =SOURCE:DESTz(You have to specify both SOURCE and DEST)refinditerrpathsep ValueErrorargparse ArgumentErroroption_stringsrendgetattrdestr%setattrappend)r*parser namespacevalue option_string separatorsrcr?s r__call__zSourceDestAction.__call__As3 peeR[1P2:1P1P1PRW%X%XeeeJII p p p(/n$J]^_J`/n/n/noo o p&Y__&&&'Y]]__%%& [$ [(/YZZ Z 9di ( (DL 8 8 Ity" - - - 49%%,,c4[99999s /2/A!N)__name__ __module__ __qualname____doc__r)rH __classcell__r-s@rr#r#:sn'+DMMMMMMM::::::::rr#ctj|sd|fS|D]\}}tj||ks Jd|z tj||g}n#t $rd}YnwxYw||kr<|t |d}|dr |dd}||fcSd|fS)Nz$path '%s' should already be absolute)r/r0)rrrr commonpathr9len startswith)r conversions from_pathto_name common_pathrests rmake_variable_pathrZUs 7== " "X~ + ! !Gwy))Y6669_bk9k666 ',,h -BCCKK   KKK  ) # #C NNOO,D{++ ABBxD= $ >s!A>> B  B c$ddlm}|d)Nr)RemovedCipherFeatureErrorz&Please remove your --key=xxx argument.)PyInstaller.exceptionsr\)xr\s rremoved_key_optionr_js&@@@@@@ # #$L M MMrceZdZfdZxZS)_RemovedFlagActioncbtj|d<d|d<tj|i|dS)Nhelprnargs)r:SUPPRESSr(r))r*r+r,r-s rr)z_RemovedFlagAction.__init__ps:!*vw$)&)))))r)rJrKrLr)rNrOs@rraraos8*********rraceZdZdZdS)_RemovedNoEmbedManifestActionc$ddlm}|d)Nr)RemovedExternalManifestErrorz0Please remove your --no-embed-manifest argument.)r]ri)r*r+r,ris rrHz&_RemovedNoEmbedManifestAction.__call__ws&GGGGGG**+]^^^rNrJrKrLrHr1rrrgrgvs(_____rrgceZdZdZdS)"_RemovedWinPrivateAssembliesActionc$ddlm}|d)Nr RemovedWinSideBySideSupportErrorz5Please remove your --win-private-assemblies argument.r]ror*r+r,ros rrHz+_RemovedWinPrivateAssembliesAction.__call__}s&KKKKKK../fgggrNrjr1rrrlrl|s(hhhhhrrlceZdZdZdS)"_RemovedWinNoPreferRedirectsActionc$ddlm}|d)Nrrnz6Please remove your --win-no-prefer-redirects argument.rprqs rrHz+_RemovedWinNoPreferRedirectsAction.__call__s&KKKKKK../ghhhrNrjr1rrrsrss(iiiiirrsceZdZdZdZdS)PathcRtjj||_dx|_|_dSrI)rrjoinvariable_prefixfilename_suffix)r*partss rr)z Path.__init__s(GL%( 6::t333rc|j!t|j\|_|_|jt |jSd|jzdzt |jzdzS)Nz os.path.join(,))rzrZrryrepr)r*s r__repr__z Path.__repr__se   '9KDI9V9V 6D $"6   ' ?? "!55;d4CW>X>XX[^^^rN)rJrKrLr)rr1rrrvrvs7;;;_____rrvcDeZdZdZdZdZdZdZdZdZ dZ d Z d S) Preamblec |pg|_|pg|_|pg|_g|_|r|d|r|d|r|d|r|d|s| r|d|jr|xjdgz c_|s|s|s| r"|d|jd|_|s|r"|d|jd|_|s|r"|d |jd |_|D]} || |D]} || | D]} || |D]} | | |D]} | | |D]} | | |jr"|jd dkr|xjdgz c_d |j|_dS) Ncollect_data_filescollect_dynamic_libscollect_submodules collect_all copy_metadatadatasbinaries hiddenimports ) rrrcontent_add_hookutil_import_add_var_add_collect_data_add_copy_metadata_add_recursive_copy_metadata_add_collect_binaries_add_collect_submodules_add_collect_allrx) r*rrr collect_datacollect_binariesrrrrecursive_copy_metadataentrys rr)zPreamble.__init__s !B *0b[b    <  % %&: ; ; ;  >  % %&< = = =  <  % %&: ; ; ;  5  % %m 4 4 4  73 7  % %o 6 6 6 < ! LLRD LL  != !K !;R ! MM'4: . . . DJ  '{ ' MM*dm 4 4 4&DM  1 1 MM/4+= > > >!0D ! * *E  " "5 ) ) ) )" + +E  # #E * * * *, 5 5E  - -e 4 4 4 4% . .E  & &u - - - -' 0 0E  ( ( / / / /  ) )E  ! !% ( ( ( ( < !DL,22 LLRD LLyy.. rcN|xjd|gz c_dS)Nz'from PyInstaller.utils.hooks import {0}rformatr*names rrzPreamble._add_hookutil_imports( BII$OOPP rcP|xjd||gz c_dS)Nz {0} = {1}r)r*r initial_values rrzPreamble._add_vars) ++D-@@AA rcN|xjd|gz c_dS)Nz"datas += collect_data_files('{0}')rrs rrzPreamble._add_collect_datas( ?FFtLLMM rcN|xjd|gz c_dS)Nzdatas += copy_metadata('{0}')rrs rrzPreamble._add_copy_metadatas( :AA$GGHH rcN|xjd|gz c_dS)Nz-datas += copy_metadata('{0}', recursive=True)rrs rrz%Preamble._add_recursive_copy_metadatas) JQQRVWWXX rcN|xjd|gz c_dS)Nz'binaries += collect_dynamic_libs('{0}')rrs rrzPreamble._add_collect_binariess( DKKDQQRR rcN|xjd|gz c_dS)Nz*hiddenimports += collect_submodules('{0}')rrs rrz Preamble._add_collect_submoduless( GNNtTTUU rcP|xjd|dgz c_dS)Nztmp_ret = collect_all('{0}')zHdatas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]rrs rrzPreamble._add_collect_alls/ , 3 3D 9 9 V  rN) rJrKrLr)rrrrrrrrr1rrrrs7/7/7/rQQQBBBNNNIIIYYYSSSVVV     rrc  |d}|dddddd|d d dd dd |d dd|ddd|dd|d}|dtdd|dtdd|dd d!dd"gd#ttjz$|d%d&d"gd'd(d)*|d+d"gd'd,d-*|d.d/d"gd'd0d1*|d2d"gd'd3d4*|d5d"gd'd6d7*|d8d"gd9d:d;*|d*|d?d"d@gdAB|dCd"dDgdEB|dFdGd"gdH|dIdJt jtK|dLdMdNdOP|dQ}|dRdSgdttzd"dTU|dVdWdXthdYddZ[|d\d]d^d"gd_$|d`dad dbc|ddd dedfg|dhdidjd"dkl|dm}|dndodpdqd ddr|dsdtdudqdddv|dwthdxddyz|d{d|d"d}d~d|ddd ded|d}|dddjdP|ddd|ddddP|dt|ddddd"gd$|ddd ded|ddd ded|d}|dt|dt|d}|ddd ded|ddd|dddddd|ddddd|ddddd|d}|ddddP|dd dedgdS)zS Add the `Makespec` options to a option-parser instance or a option group. zWhat to generatez-Dz--onedironefile store_falseNz=Create a one-folder bundle containing an executable (default))r?actionr%rcz-Fz --onefile store_truez%Create a one-file bundled executable.z --specpathDIRzDFolder to store the generated spec file (default: current directory))r&rcz-nz--namezRName to assign to the bundled app and spec file (default: first script's basename))rcz--contents-directoryzFor onedir builds only, specify the name of the directory in which all supporting files (i.e. everything except the executable itself) will be placed in. Use "." to re-enable old onedir layout without contents directory.zWhat to bundle, where to searchz --add-dataraAdditional data files or directories containing data files to be added to the application. The argument value should be in form of "source:dest_dir", where source is the path to file (or directory) to be collected, dest_dir is the destination directory relative to the top-level application directory, and both paths are separated by a colon (:). To put a file in the top-level application directory, use . as a dest_dir. This option can be used multiple times.)rr?rcz --add-binaryrzAdditional binary files to be added to the executable. See the ``--add-data`` option for the format. This option can be used multiple times.z-pz--pathspathexrAzA 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?r&rr%rcz--hidden-importz--hiddenimport MODULENAMErz`Name an import not visible in the code of the script(s). This option can be used multiple times.)rr%r&r?rcz--collect-submodulesrzdCollect all submodules from the specified package or module. This option can be used multiple times.z--collect-dataz--collect-datasrz^Collect all data from the specified package or module. This option can be used multiple times.z--collect-binariesrzbCollect all binaries from the specified package or module. This option can be used multiple times.z --collect-allrz~Collect all submodules, data files, and binaries from the specified package or module. This option can be used multiple times.z--copy-metadata PACKAGENAMErzPCopy metadata for the specified package. This option can be used multiple times.z--recursive-copy-metadatarziCopy 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.)rr?r%rcz--runtime-hook runtime_hookszPath 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-moduleexcludeszOptional 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--keykey)r?rctypez--splashsplash 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?r&rczHow 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. )r%rdchoicesrrcz --optimizeoptimizeLEVEL>rr0ruBytecode optimization level used for collected python modules and scripts. For details, see the section “Bytecode Optimization Level” in PyInstaller manual.)r?r&rrr%rcz--python-optionpython_options PYTHON_OPTIONa%Specify a command-line option to pass to the Python interpreter at runtime. Currently supports "v" (equivalent to "--debug imports"), "u", "W ", "X ", and "hash_seed=". For details, see the section "Specifying Python Interpreter Options" in PyInstaller manual.z-sz--stripzZApply a symbol-table strip to the executable and shared libs (not recommended for Windows))rrcz--noupxFzSDo not use UPX even if it is available (works differently between Windows and *nix))rr%rcz --upx-exclude upx_excludeFILEzPrevent 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?r&rrcz"Windows and macOS specific optionsz-cz --consolez --nowindowedconsolez|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 --noconsolezWindows and macOS: do not provide a console window for standard i/o. On macOS this also triggers building a macOS .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--hide-console> hide-late hide-early minimize-lateminimize-earlyzWindows only: in console-enabled executable, have bootloader automatically hide or minimize the console window if the program owns the console window (i.e., was not launched from an existing console window).)rrr%rcz-iz--icon icon_filez9aFILE.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 macOS. 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.)rr?r&rcz--disable-windowed-tracebackdisable_windowed_tracebackzDisable 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 --manifestz z$Add manifest FILE or XML to the exe.z-mshorthand_manifestz$Deprecated shorthand for --manifest.z--no-embed-manifest)rz-rz --resource resourcesRESOURCEaAdd 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-assembliesz--win-no-prefer-redirectszmacOS specific optionsz--argv-emulationargv_emulationzEnable 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-identifierbundle_identifierzmacOS .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?rcz--target-architecturez --target-arch target_archARCHa9Target 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?r&r%rcz--codesign-identitycodesign_identityIDENTITYzCode 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-fileentitlements_fileFILENAMEzOEntitlements file to use when code-signing the collected binaries (macOS only).zRarely used special optionsz--runtime-tmpdirruntime_tmpdirPATHaWhere 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. Note that on POSIX systems, PyInstaller's bootloader does NOT perform shell-style environment variable expansion on the given path string. Therefore, using environment variables (e.g., ``~`` or ``$HOME``) in path will NOT work.z--bootloader-ignore-signalszTell 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#rrr8r:rer_DEBUG_ALL_CHOICEDEBUG_ARGUMENT_CHOICESintstrrgrlrs)rBgs r __add_optionsrs  !!"455ANN   L NN   4 NN S NN  a NN !!"CDDANN <    NN 2 NN  o RZ   NN  oNN ! s NN  mNN  q NN " NN  _ NN# & NN   ^ NN & NN > NN      NN 4  !!"344ANN  #99 &&&NNN   C   NN f    NN  i  NN b  NN   !!"FGGANN  #   NN  8   NN NNNr NN  Kd    NN& )G  !!"<==ANN  ;  NN 3 NN ! 3  NN,NN  u   NN  g NN  \  !!"^__ANN"1NN#1 !!":;;ANN b NN! -NN t    NN ` NN!  ^  !!"?@@ANN X    NN%> rFTc)  |d}|d}|Htjtj|dd} t ntj  t kr%tjt | tj stj d}*| r|*dt| zz }*|r|*dz }*|r|*dz }*|rC|ddkr|*d z }*n%|*d d d |Dzz }*d |dz}nd}| r |*d| pdzz }*|'r|*d|'zz }*|rd |z}|)dr.|)d}t tjd||r6d|vr|*d|ddzz }*n|*dt|zz }*|r7t!t#t|}|*dt%|zz }*|pg}|pg}t&r/|r-|s+ddlm}+t tj|+t,r1tj|dddkrd} fd|D}t!t#t.|}|g}t0d|vrt2}t5|||||||| |" },|!rt6d|!iz}-d}.d}/ndx}-x}.}/t9d |D}0|0d!krtd"|0d!}0|(|0dkrt<jj }(n+|0}(n(|(|0kr"|0dkrtd#|(|0|(dkr|tCd|(|0z d$gzz }d%|vrd&|vr|"d&d'|D}1id(|d)| pgd*|,j#d+|,j$d,|,j%d-|,j&d.|d/d/|vd0|(d1|1d2d3|vd4|d5|d6| d7|d8| d9|*||pg|pg|||||&|#|$|%|-|/|.d:}2tj |d;z}3tO|3d5}4|rD|4(tR|2zt&r|s|4(tT|2znC|4(tV|2zt&r|s|4(tX|2zdddn #1swxYwY|3S)?NFTrrz version='%s',z uac_admin=True,z uac_uiaccess=True,NONEz icon='NONE',z icon=[%s],r}c3:K|]}dt|zVdS)'%s'N)r)r2ics rr4zmain..s28n8n^`BUVXBYBY9Y8n8n8n8n8n8nrrNonez contents_directory='%s', _internalz hide_console='%s',rzRPyInstaller v7 will remove the -m shorthand flag. Please use --manifest=%s insteadzmain..s$EEE&q(33EEEr splash_imagez splash.binaries,z splash,cg|]}|dk S)Or1r2opts rrzmain..2s:::CSCZ:::rrzbThe switch '--python-option O' has been specified %d times - it should be specified at most twice!zvMismatch between optimization level passed via --optimize switch (%d) and number of '--python-option O' switches (%d)!rr vcg|]}|ddfS)NOPTIONr1rs rrzmain..PsLLLcS$1LLLrscriptsrrrrpreamblerrroptionsdebug_bootloaderrbootloader_ignore_signalsstripupxrr exe_options)rrrrriconrrrrr splash_init splash_targetsplash_binariesz.specwzutf-8)encoding)-rrsplitextbasenamer expanduserrrxexistsmakedirsrloggerrlogging DEPRECATIONrlistmaprr PyInstaller.building.osxrr rvrrrr sumwarningsysflagsrmaxrArrrropenwriter rrr)5rrrrdebugrrnoupxrrcontents_directoryrrrrrrrrmanifestrrrrrrrrrrrrrrrrrrr hide_consoler_kwargsrrrrrr opt_levelpython_options_arraydspecfnmspecfiles5 ` rmainr sZ |w 0 0 < <==a@#7%%h//87<<$// 7>>( # # HKQ,/B

> !'RM#KEWEWEHHHHHH 7&(CDDD"'""71:..r2f<<FEEEWEEEG3tW%%&&G }e##& x 6FHZ\givH ; NF#;; 2' 8:: :o ::>:::;;I1}} p      >>y)HH!HH Y  9>>       1}}#aI!566#>>Ec77c"""LL^LLL+ 7+ &,B+  H%+   +  / +  H$ +  +  [E)+  H+  '+  LE1+  $%>+  +  5y+  {+  .!+ " {#+ &&,"N&@.(".."&*U+ + + A\gll8TG^44G gsW - - - 0  0 NNr's' 22222222&&&&&&mmmmmmmmmmmmmm00000000  8 $ $@??7888   "z*,:::::x:::6.>*NNN ********_____$6___ hhhhh);hhh iiiii);iii _ _ _ _ _ _ _ _S S S S S S S S lfffV        #$     Suuuuuur