mς Σ”’Ac@sodZdkZdkZdkZdklZdklZdkl Z ei dZ defd„ƒYZ dS(s7$Id: install_lib.py 37828 2004-11-10 22:23:15Z loewis $N(sIntType(sCommand(sDistutilsOptionErrortpyt install_libc Bs‘tZdZdd d!d"d#d$d%gZdd dgZhdd t|iƒ|_d |ijo d jnpt‚WqΦt tfj ot d ‚qΦXndS(Ntinstallt build_libR RR RRR Riiisoptimize must be 0, 1, or 2(s build_libs build_dir(s install_libs install_dir(sforcesforce(scompilescompile(soptimizesoptimize(s skip_builds skip_build( R tset_undefined_optionsRR R ttypetIntTypetinttAssertionErrort ValueErrortDistutilsOptionError(R ((Rtfinalize_options;s"   ,cCsH|iƒ|iƒ}|dj o!|iiƒo|i|ƒndS(N(R tbuildRtoutfilesR t distributionthas_pure_modulest byte_compile(R R((RtrunUs  cCsT|ipF|iiƒo|idƒn|iiƒo|idƒqPndS(Ntbuild_pyt build_ext(R RRRt run_commandthas_ext_modules(R ((RRis  cCsNtii|iƒo|i|i|iƒ}n|id|iƒdS|S(Ns3'%s' does not exist -- no Python modules to install( tostpathtisdirR R t copy_treeR Rtwarn(R R((RRps c Cs‘dkl}|idƒi}|io,||ddd|id|d|i ƒn|i djo8||d|i d|id|d|i d|i ƒndS( N(s byte_compileRR iRtprefixtdry_runtverbose( tdistutils.utilRR tget_finalized_commandtroott install_rootRtfilesRR+R R,(R R1RR0((RRys   c Cs|pgSn|i|ƒ}|iƒ}t||ƒ}t |ƒt t i ƒ} g}x.|D]&}|it ii||| ƒƒq_W|S(N(thas_anyR R.t build_cmdt get_outputst build_filestgetattrt cmd_optionR tlenR%tsept prefix_lentoutputstfiletappendR&tjoint output_dir( R R2R3R7R?R<R;R R5R:((Rt_mutate_outputsŽs $cCs•g}xˆ|D]€}tiitii|ƒƒd}|tjoq n|i o|i |dƒn|i djo|i |dƒq q W|S(NiRito( tbytecode_filest py_filenamestpy_fileR%R&tsplitexttnormcasetexttPYTHON_SOURCE_EXTENSIONR RR=R (R RCRGRBRD((Rt_bytecode_filenames s"  cCsw|i|iiƒdd|iƒ}|io|i|ƒ}ng}|i|ii ƒdd|iƒ}|||S(sΑ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"N( R R@RRR t pure_outputsRRItbytecode_outputsR$t ext_outputs(R RJRKRL((RR4΄s   cCsvg}|iiƒo&|idƒ}|i|iƒƒn|iiƒo&|idƒ}|i|iƒƒn|S(sώ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"N( tinputsR RRR.R!textendR4R$R"(R RMR"R!((Rt get_inputsΛs(s install-dir=Rsdirectory to install to(s build-dir=Rs'build directory (where to install from)(sforceRs-force installation (overwrite existing files)(scompileRscompile .py to .pyc [default](s no-compileNsdon't compile .py files(s optimize=Rslalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0](s skip-buildNsskip the build steps(t__name__t __module__t descriptionR t user_optionstboolean_optionst negative_optRRR RRRR@RIR4RO(((RRs        ( t __revision__tsysR%tstringttypesRtdistutils.coretCommandtdistutils.errorsRtextsepRHR( RVRRXRHRWR[RR%R((Rt?s