%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/distutils/command/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/distutils/command/build_py.pyo

ó
Pêáac@s”dZdZddlZddlZddlmZddlmZddlmZm	Z	ddl
mZddl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„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((s6/usr/local/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
|jtƒsîyt|jƒ|_Wqît
tfk
rêtdƒ‚qîXndS(NtbuildRRsoptimize must be 0, 1, or 2(RR(RR(tset_undefined_optionstdistributiontpackagesRRRtitemsRtget_data_filest
data_filest
isinstanceRtintt
ValueErrortAssertionErrorR(Rtnametpath((s6/usr/local/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_compiletget_outputs(R((s6/usr/local/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((s6/usr/local/lib/python2.7/distutils/command/build_py.pyRbs	%)cCs¢|jjdgƒ|jj|gƒ}g}xm|D]e}ttjj|t|ƒƒƒ}|jg|D]*}||kritjj|ƒri|^qiƒq5W|S(s6Return filenames for package's data files in 'src_dir't(	RtgetRR-R"R.Rtextendtisfile(RRR4tglobstfilestpatterntfilelisttfn((s6/usr/local/lib/python2.7/distutils/command/build_py.pyR1zs
!#cCsˆ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((s6/usr/local/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((s6/usr/local/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.R<RtwarnR
(RRRtinit_py((s6/usr/local/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"R<RRORFtTrue(Rtmoduletmodule_file((s6/usr/local/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|jd|ƒqPW|S(Ns*.pyisexcluding %s(RQRR-R"R.tabspathRtscript_nametsplitexttbasenameR2tdebug_print(	RRRtmodule_filestmodulestsetup_scriptRtabs_fRS((s6/usr/local/lib/python2.7/distutils/command/build_py.pytfind_package_modulesÚs
"cCs!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.RIR,RQR2R-R"RU(RRR\RSR"Rtmodule_baseRtcheckedRPRT((s6/usr/local/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((s6/usr/local/lib/python2.7/distutils/command/build_py.pytfind_all_moduless		cCs!g|jƒD]}|d^q
S(Niÿÿÿÿ(Re(RRS((s6/usr/local/lib/python2.7/distutils/command/build_py.pytget_source_files-scCs.|gt|ƒ|dg}tjj|ŒS(Ns.py(tlistR-R"R.(RR5RRStoutfile_path((s6/usr/local/lib/python2.7/distutils/command/build_py.pytget_module_outfile0sicCsõ|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\toutputsRRSRTRGR4R5R8((s6/usr/local/lib/python2.7/distutils/command/build_py.pyR)4s 
	)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 tupleRBi(
RtstrR/Rgttuplet	TypeErrorRiRR-R"RDRCRE(RRSRTRtoutfiletdir((s6/usr/local/lib/python2.7/distutils/command/build_py.pytbuild_moduleIs
cCs=|jƒ}x*|D]"\}}}|j|||ƒqWdS(N(RcRq(RR\RRSRT((s6/usr/local/lib/python2.7/distutils/command/build_py.pyR%XscCsfx_|jD]T}|j|ƒ}|j||ƒ}x*|D]"\}}}|j|||ƒq8Wq
WdS(N(RR,R_Rq(RRRR\tpackage_RSRT((s6/usr/local/lib/python2.7/distutils/command/build_py.pyR&bs
c
CsËtjr|jdƒdSddlm}|j}|dtjkrV|tj}n|jrŠ||ddd|j	d|d|j
ƒn|jdkrÇ||d|jd|j	d|d|j
ƒndS(	Ns%byte-compiling is disabled, skipping.iÿÿÿÿ(R(RiRtprefixtdry_run(tsystdont_write_bytecodeROtdistutils.utilR(RR-tsepRRRtR(RR>R(Rs((s6/usr/local/lib/python2.7/distutils/command/build_py.pyR(ws	
		(s
build-lib=Rsdirectory to "build" (copy) to(RR	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](RRs2forcibly build everything (ignore file timestamps)(t__name__t
__module__tdescriptionR
tuser_optionstboolean_optionstnegative_optRR#R*RR1R'R,RQRUR_RcReRfRiR)RqR%R&R((((s6/usr/local/lib/python2.7/distutils/command/build_py.pyRs8	
	
				
			(				4					
	(t__doc__t__revision__R-RuRtdistutils.coreRtdistutils.errorsRRRwRt	distutilsRR(((s6/usr/local/lib/python2.7/distutils/command/build_py.pyt<module>s

Zerion Mini Shell 1.0