a „oeÙ ã@sLdZddlZddlZddlZddlmZddlmZdZ Gdd„deƒZ dS) zkdistutils.command.install_lib Implements the Distutils 'install_lib' command (install all Python modules).éNé)ÚCommand)ÚDistutilsOptionErrorz.pyc@sxeZdZdZgd¢Zgd¢ZddiZdd„Zdd „Zd d „Z d d „Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)Ú install_libz7install all Python modules (extensions and pure Python)))z install-dir=Údzdirectory to install to)z build-dir=Úbz'build directory (where to install from))ÚforceÚfz-force installation (overwrite existing files))ÚcompileÚczcompile .py to .pyc [default])ú no-compileNzdon't compile .py files)z optimize=ÚOzlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])ú skip-buildNzskip the build steps)rr rr r cCs(d|_d|_d|_d|_d|_d|_dS)Nr)Ú install_dirÚ build_dirrr ÚoptimizeÚ skip_build©Úself©rúJC:\Program Files\Certbot\pkgs\setuptools\_distutils\command\install_lib.pyÚinitialize_options6s zinstall_lib.initialize_optionsc Cs„| ddddddd¡|jdur&d|_|jdur6d |_t|jtƒs€zt|jƒ|_|jd vr^t‚Wnttfy~td ƒ‚Yn0dS) NÚinstall)Ú build_libr)rr)rr)r r )rr)rrTF)rérzoptimize must be 0, 1, or 2)Zset_undefined_optionsr rÚ isinstanceÚintÚAssertionErrorÚ ValueErrorrrrrrÚfinalize_options?s(ù     zinstall_lib.finalize_optionscCs0| ¡| ¡}|dur,|j ¡r,| |¡dS©N)ÚbuildrÚ distributionÚhas_pure_modulesÚ byte_compile©rZoutfilesrrrÚrunZszinstall_lib.runcCs2|js.|j ¡r| d¡|j ¡r.| d¡dS)NÚbuild_pyÚ build_ext)rr"r#Z run_commandÚhas_ext_modulesrrrrr!js    zinstall_lib.buildcCs8tj |j¡r | |j|j¡}n| d|j¡dS|S)Nz3'%s' does not exist -- no Python modules to install)ÚosÚpathÚisdirrZ copy_treerÚwarnr%rrrrqsÿzinstall_lib.installcCsrtjr| d¡dSddlm}| d¡j}|jrH||d|j||j d�|j dkrn|||j |j||j |j d�dS)Nz%byte-compiling is disabled, skipping.r)r$rr)rrÚprefixÚdry_run)rrr.Úverboser/) ÚsysÚdont_write_bytecoder-Úutilr$Úget_finalized_commandÚrootr rr/rr0)rÚfilesr$Z install_rootrrrr${s,   û úzinstall_lib.byte_compilec Csd|sgS| |¡}| ¡}t||ƒ}t|ƒttjƒ}g}|D] } | tj || |d…¡¡q>|Sr ) r4Ú get_outputsÚgetattrÚlenr*ÚsepÚappendr+Újoin) rZhas_anyZ build_cmdZ cmd_optionZ output_dirZ build_filesrÚ prefix_lenZoutputsÚfilerrrÚ_mutate_outputsœs  zinstall_lib._mutate_outputscCsrg}|D]d}tj tj |¡¡d}|tkr.q|jrJ| tjj |dd�¡|j dkr| tjj ||j d�¡q|S)NrÚ)Ú optimizationr) r*r+ÚsplitextÚnormcaseÚPYTHON_SOURCE_EXTENSIONr r;Ú importlibr3Úcache_from_sourcer)rZ py_filenamesZbytecode_filesZpy_fileÚextrrrÚ_bytecode_filenames«s ÿ ÿÿzinstall_lib._bytecode_filenamescCsR| |j ¡dd|j¡}|jr*| |¡}ng}| |j ¡dd|j¡}|||S)zÁReturn the list of files that would be installed if this command were actually run. Not affected by the "dry-run" flag or whether modules have actually been built yet. r'rr()r?r"r#rr rHr))rZ pure_outputsZbytecode_outputsZ ext_outputsrrrr7Äs ü üzinstall_lib.get_outputscCsLg}|j ¡r&| d¡}| | ¡¡|j ¡rH| d¡}| | ¡¡|S)zþGet the list of files that are input to this command, ie. the files that get installed as they are named in the build tree. The files in this list correspond one-to-one to the output filenames returned by 'get_outputs()'. r'r()r"r#r4Úextendr7r))rZinputsr'r(rrrÚ get_inputsÝs    zinstall_lib.get_inputsN)Ú__name__Ú __module__Ú __qualname__Ú descriptionZ user_optionsZboolean_optionsZ negative_optrrr&r!rr$r?rHr7rJrrrrrs  !r) Ú__doc__r*Úimportlib.utilrEr1ZcorerÚerrorsrrDrrrrrÚs