tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
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
\\¬Qc@s”dZdZddlZddlZddlmZddlmZddlmZm    Z    ddl
m Z ddl m Z d    efd
„ƒYZdS( sHdistutils.command.build_py
 
Implements the Distutils 'build_py' command.s$Id$iÿÿÿÿN(tglob(tCommand(tDistutilsOptionErrortDistutilsFileError(t convert_path(tlogtbuild_pycBsêeZdZd#d$d&d'd(gZdd gZidd6Zd„Zd„Zd„Z    d„Z
d„Z d„Z d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd „Zd!„Zd"„ZRS()s5"build" pure Python modules (copy to build directory)s
build-lib=tdsdirectory to "build" (copy) totcompiletcscompile .py to .pycs
no-compiles!don't compile .py files [default]s    optimize=tOslalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]tforcetfs2forcibly build everything (ignore file timestamps)cCsLd|_d|_d|_d|_d|_d|_d|_d|_dS(Ni(    tNonet    build_libt
py_modulestpackaget package_datat package_dirRtoptimizeR (tself((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pytinitialize_options!s                            cCs|jdddƒ|jj|_|jj|_|jj|_i|_|jjrŽx6|jjjƒD]\}}t|ƒ|j|<qhWn|jƒ|_    t
|j t ƒsy;t |j ƒ|_ d|j koÞdknsét ‚Wqtt fk
rtdƒ‚qXndS(    NtbuildRR iisoptimize must be 0, 1, or 2(s    build_libs    build_lib(sforcesforce(tset_undefined_optionst distributiontpackagesRRRtitemsRtget_data_filest
data_filest
isinstanceRtinttAssertionErrort
ValueErrorR(Rtnametpath((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pytfinalize_options+s"         )cCsS|jr|jƒn|jr6|jƒ|jƒn|j|jddƒƒdS(Ntinclude_bytecodei(Rt build_modulesRtbuild_packagestbuild_package_datat byte_compilet get_outputs(R((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pytrunDs          
 cCsÀg}|js|Sx¦|jD]›}|j|ƒ}tjj|jg|jdƒŒ}d}|rvt|ƒd}ng|j||ƒD]}||^q‰}|j    ||||fƒqW|S(s?Generate list of '(package,src_dir,build_dir,filenames)' tuplest.ii(
Rtget_package_dirtosR"tjoinRtsplittlentfind_data_filestappend(RtdataRtsrc_dirt    build_dirtplentfilet    filenames((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyRbs    %)cCs|jjdgƒ|jj|gƒ}g}x[|D]S}ttjj|t|ƒƒƒ}|jg|D]}||kri|^qiƒq5W|S(s6Return filenames for package's data files in 'src_dir't(RtgetRR-R"R.Rtextend(RRR4tglobstfilestpatterntfilelisttfn((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyR1zs !0cCsˆx|jD]v\}}}}xa|D]Y}tjj||ƒ}|jtjj|ƒƒ|jtjj||ƒ|dtƒq#Wq
WdS(s$Copy data files into build directoryt preserve_modeN(RR-R"R.tmkpathtdirnamet    copy_filetFalse(RRR4R5R8tfilenamettarget((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyR'†s  cCs|jdƒ}|js5|r.tjj|ŒSdSnÇg}x¾|r°y|jdj|ƒ}Wn,tk
rŒ|jd|dƒ|d=q>X|jd|ƒtjj|ŒSq>W|jjdƒ}|dk    râ|jd|ƒn|røtjj|ŒSdSdS(s½Return the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any).R+R9iiÿÿÿÿN(    R/RR-R"R.tKeyErrortinsertR:R (RRR"ttailtpdir((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyR,s(               cCs¥|dkrYtjj|ƒs1td|ƒ‚ntjj|ƒsYtd|ƒ‚qYn|r¡tjj|dƒ}tjj|ƒrŠ|Stjdd|ƒndS(NR9s%package directory '%s' does not exists>supposed package directory '%s' exists, but is not a directorys __init__.pys!package init file '%s' not found s(or not a regular file)(
R-R"texistsRtisdirR.tisfileRtwarnR (RRRtinit_py((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyt check_package·s     cCs1tjj|ƒs)tjd||ƒtStSdS(Ns!file %s (for module %s) not found(R-R"RNRROREtTrue(Rtmodulet module_file((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyt check_moduleÒsc    CsÈ|j||ƒttjj|dƒƒ}g}tjj|jjƒ}xx|D]p}tjj|ƒ}||kr¯tjjtjj    |ƒƒd}|j
|||fƒqP|j d|ƒqPW|S(Ns*.pyis excluding %s( RQRR-R"R.tabspathRt script_nametsplitexttbasenameR2t debug_print(    RRRt module_filestmodulest setup_scriptR tabs_fRS((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pytfind_package_modulesÙs  "c Cs!i}g}x|jD]}|jdƒ}dj|dd!ƒ}|d}y||\}}Wn&tk
r‡|j|ƒ}d}nX|sÒ|j||ƒ}    |df||<|    rÒ|j|d|    fƒqÒntjj||dƒ}
|j    ||
ƒsqn|j|||
fƒqW|S(sÈFinds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        R+iiÿÿÿÿit__init__s.py(
RR/R.RHR,RQR2R-R"RU( RRR\RSR"Rt module_baseRtcheckedRPRT((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyt find_modulesès*
 
cCswg}|jr%|j|jƒƒn|jrsxB|jD]4}|j|ƒ}|j||ƒ}|j|ƒq8Wn|S(s4Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do.(RR;RcRR,R_(RR\RRtm((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pytfind_all_moduless        cCs!g|jƒD]}|d^q S(Niÿÿÿÿ(Re(RRS((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pytget_source_files,scCs.|gt|ƒ|dg}tjj|ŒS(Ns.py(tlistR-R"R.(RR5RRSt outfile_path((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pytget_module_outfile/sic Csõ|jƒ}g}x”|D]Œ\}}}|jdƒ}|j|j||ƒ}|j|ƒ|r|jr|j|dƒn|jdkr¥|j|dƒq¥qqW|g|jD]4\}}}    }
|
D]}tj    j
|    |ƒ^qÌq¶7}|S(NR+R    ito( ReR/RiRR2RRRR-R"R.( RR$R\toutputsRRSRTRFR4R5R8((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyR)3s       )cCs’t|tƒr!|jdƒ}n$t|ttfƒsEtdƒ‚n|j|j||ƒ}tj    j
|ƒ}|j |ƒ|j ||ddƒS(NR+s:'package' must be a string (dot-separated), list, or tupleRAi( RtstrR/Rgttuplet    TypeErrorRiRR-R"RCRBRD(RRSRTRtoutfiletdir((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyt build_moduleHs  cCs=|jƒ}x*|D]"\}}}|j|||ƒqWdS(N(RcRq(RR\RRSRT((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyR%Ws cCsxxq|jD]f}|j|ƒ}|j||ƒ}x<|D]4\}}}||ksYt‚|j|||ƒq8Wq
WdS(N(RR,R_RRq(RRRR\tpackage_RSRT((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyR&as  c
CsËtjr|jdƒdSddlm}|j}|dtjkrV|tj}n|jrŠ||ddd|j    d|d|j
ƒn|j dkrÇ||d|j d|j    d|d|j
ƒndS(    Ns%byte-compiling is disabled, skipping.iÿÿÿÿ(R(RiR tprefixtdry_run( tsystdont_write_bytecodeROtdistutils.utilR(RR-tsepRR RtR(RR=R(Rs((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyR(vs             (s
build-lib=Rsdirectory to "build" (copy) to(scompileR    scompile .py to .pycN(s
no-compileNs!don't compile .py files [default](s    optimize=R
slalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0](sforceR s2forcibly build everything (ignore file timestamps)(t__name__t
__module__t descriptionR t user_optionstboolean_optionst negative_optRR#R*RR1R'R,RQRUR_RcReRfRiR)RqR%R&R((((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyRs8          
                           (                4                     
   (t__doc__t __revision__R-RuRtdistutils.coreRtdistutils.errorsRRRwRt    distutilsRR(((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/command/build_py.pyt<module>s