ACC SHELL

Path : /usr/lib/python/distutils/command/
File Upload :
Current File : //usr/lib/python/distutils/command/build_py.pyc

Ñò
tÄMc@sždZdZddkZddkZddkTddkZddklZddklZddk	Tddk
lZddkl
Z
d	efd
„ƒYZdS(sHdistutils.command.build_py

Implements the Distutils 'build_py' command.s9$Id: build_py.py 77376 2010-01-08 23:27:23Z tarek.ziade $iÿÿÿÿN(t*(tglob(tCommand(tconvert_path(tlogtbuild_pycBsêeZdZd#d$d&d'd(gZddgZhdd6Zd„Zd„Zd„Z	d„Z
d„Zd„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_datatpackage_dirRtoptimizeR
(tself((s0/usr/lib/python2.6/distutils/command/build_py.pytinitialize_options%s							cCs |idddƒ|ii|_|ii|_|ii|_h|_|iio:x7|iiiƒD]\}}t|ƒ|i|<qiWn|iƒ|_	t
|iƒtj	ogy>t
|iƒ|_d|ijo
djnpt‚Wqttfj
otd‚qXndS(	NtbuildR
R
iisoptimize must be 0, 1, or 2(s	build_libs	build_lib(sforcesforce(tset_undefined_optionstdistributiontpackagesRRRtitemsRtget_data_filest
data_filesttypeRtIntTypetinttAssertionErrort
ValueErrortDistutilsOptionError(Rtnametpath((s0/usr/lib/python2.6/distutils/command/build_py.pytfinalize_options/s$		
,cCsW|io|iƒn|io|iƒ|iƒn|i|iddƒƒdS(Ntinclude_bytecodei(Rt
build_modulesRtbuild_packagestbuild_package_datatbyte_compiletget_outputs(R((s0/usr/lib/python2.6/distutils/command/build_py.pytrunHs


c	CsÌg}|ip|Sx°|iD]¥}|i|ƒ}tii|ig|idƒŒ}d}|ot|ƒd}ng}|i||ƒD]}|||q‘~}|i	||||fƒqW|S(s?Generate list of '(package,src_dir,build_dir,filenames)' tuplest.ii(
Rtget_package_dirtosR#tjoinR
tsplittlentfind_data_filestappend(	RtdataRtsrc_dirt	build_dirtplent_[1]tfilet	filenames((s0/usr/lib/python2.6/distutils/command/build_py.pyRis

%1c	Cs|iidgƒ|ii|gƒ}g}xh|D]`}ttii|t|ƒƒƒ}|ig}|D]}||jo||qmqm~ƒq5W|S(s6Return filenames for package's data files in 'src_dir't(RtgetRR.R#R/Rtextend(	RRR5tglobstfilestpatterntfilelistR8tfn((s0/usr/lib/python2.6/distutils/command/build_py.pyR2s!=cCsŽd}x|iD]v\}}}}xa|D]Y}tii||ƒ}|itii|ƒƒ|itii||ƒ|dtƒq)WqWdS(s$Copy data files into build directoryt
preserve_modeN(	RRR.R#R/tmkpathtdirnamet	copy_filetFalse(RtlastdirRR5R6R:tfilenamettarget((s0/usr/lib/python2.6/distutils/command/build_py.pyR(s
cCsti|dƒ}|ip#|ottii|ƒSdSnÖg}xÌ|ory|iti|dƒ}Wn.tj
o"|id|dƒ|d=qHX|id|ƒtii|ŒSqHW|ii	dƒ}|dj	o|id|ƒn|ottii|ƒ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,R;iiÿÿÿÿN(tstringR0RtapplyR.R#R/tKeyErrortinsertR<R(RRR#ttailtpdir((s0/usr/lib/python2.6/distutils/command/build_py.pyR-—s*
	
cCs­|djoPtii|ƒptd|‚ntii|ƒptdd|‚q]n|oEtii|dƒ}tii|ƒo|Stidd|ƒndS(NR;s%package directory '%s' does not exists(supposed package directory '%s' exists, sbut is not a directorys__init__.pys!package init file '%s' not found s(or not a regular file)(
R.R#texiststDistutilsFileErrortisdirR/tisfileRtwarnR(RRRtinit_py((s0/usr/lib/python2.6/distutils/command/build_py.pyt
check_packageÂs
	cCs3tii|ƒptid||ƒdSdSdS(Ns!file %s (for module %s) not foundii(R.R#RTRRU(Rtmoduletmodule_file((s0/usr/lib/python2.6/distutils/command/build_py.pytcheck_moduleásc	CsÊ|i||ƒttii|dƒƒ}g}tii|iiƒ}xz|D]r}tii|ƒ}||jo<tiitii	|ƒƒd}|i
|||fƒqP|id|ƒqPW|S(Ns*.pyisexcluding %s(RWRR.R#R/tabspathRtscript_nametsplitexttbasenameR3tdebug_print(	RRRtmodule_filestmodulestsetup_scriptRtabs_fRX((s0/usr/lib/python2.6/distutils/command/build_py.pytfind_package_modulesës
"c	Cs/h}g}x|iD]}ti|dƒ}ti|dd!dƒ}|d}y||\}}Wn(tj
o|i|ƒ}d}nX|pG|i||ƒ}	|df||<|	o|i|d|	fƒqÞnti	i||dƒ}
|i
||
ƒpqn|i|||
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(RRKR0R/RMR-RWR3R.R#RZ(RRRaRXR#Rtmodule_baseRtcheckedRVRY((s0/usr/lib/python2.6/distutils/command/build_py.pytfind_modulesûs,

cCs{g}|io|i|iƒƒn|ioFxC|iD]4}|i|ƒ}|i||ƒ}|i|ƒq;Wn|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=RhRR-Rd(RRaRRtm((s0/usr/lib/python2.6/distutils/command/build_py.pytfind_all_modules4s


cCs8|iƒ}g}x|D]}|i|dƒqW|S(Niÿÿÿÿ(RjR3(RRaR:RX((s0/usr/lib/python2.6/distutils/command/build_py.pytget_source_filesIscCs.|gt|ƒ|dg}tii|ŒS(Ns.py(tlistR.R#R/(RR6RRXtoutfile_path((s0/usr/lib/python2.6/distutils/command/build_py.pytget_module_outfileSsic
Cs|iƒ}g}x|D]•\}}}ti|dƒ}|i|i||ƒ}|i|ƒ|oH|io|i|dƒn|idjo|i|dƒq®qqW|g}|iD]5\}}	}
}|D]}|t	i
i|
|ƒqÙqÃ~7}|S(NR,Rito(RjRKR0RnR
R3RRRR.R#R/(RR%RatoutputsRRXRYRIR8R5R6R:((s0/usr/lib/python2.6/distutils/command/build_py.pyR*Xs"

-cCsœt|ƒtjoti|dƒ}n't|ƒttfjo
td‚n|i|i||ƒ}t	i
i|ƒ}|i|ƒ|i
||ddƒS(NR,s:'package' must be a string (dot-separated), list, or tupleRCi(Rt
StringTypeRKR0tListTypet	TupleTypet	TypeErrorRnR
R.R#RERDRF(RRXRYRtoutfiletdir((s0/usr/lib/python2.6/distutils/command/build_py.pytbuild_modulens

cCs=|iƒ}x*|D]"\}}}|i|||ƒqWdS(N(RhRw(RRaRRXRY((s0/usr/lib/python2.6/distutils/command/build_py.pyR&~scCszxs|iD]h}|i|ƒ}|i||ƒ}x>|D]6\}}}||jpt‚|i|||ƒq8Wq
WdS(N(RR-RdRRw(RRRRatpackage_RXRY((s0/usr/lib/python2.6/distutils/command/build_py.pyR'Œs
cCsÓtio|idƒdSddkl}|i}|dtijo|ti}n|io,||ddd|i	d|d|i
ƒn|idjo/||d|id|i	d|d|i
ƒndS(	Ns%byte-compiling is disabled, skipping.iÿÿÿÿ(R)RiR
tprefixtdry_run(tsystdont_write_bytecodeRUtdistutils.utilR)R
R.tsepRR
RzR(RR?R)Ry((s0/usr/lib/python2.6/distutils/command/build_py.pyR)¥s

	
(s
build-lib=Rsdirectory to "build" (copy) to(scompileRscompile .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](sforceRs2forcibly build everything (ignore file timestamps)(t__name__t
__module__tdescriptionRtuser_optionstboolean_optionstnegative_optRR$R+RR2R(R-RWRZRdRhRjRkRnR*RwR&R'R)(((s0/usr/lib/python2.6/distutils/command/build_py.pyRs8	
	
		!			
	+		
		9		
				(t__doc__t__revision__RKR.ttypesR{Rtdistutils.coreRtdistutils.errorsR}Rt	distutilsRR(((s0/usr/lib/python2.6/distutils/command/build_py.pyt<module>s



ACC SHELL 2018