Your IP : 3.138.134.163


Current Path : /opt/alt/python33/lib64/python3.3/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/distutils/command/__pycache__/build_py.cpython-33.pyc

�
��f)Cc@s�dZddlZddlZddlZddlmZddlmZddlTddlm	Z	m
Z
ddlmZGdd	�d	e�Z
Gd
d�de
e
�ZdS(uHdistutils.command.build_py

Implements the Distutils 'build_py' command.iN(uglob(uCommand(u*(uconvert_pathu	Mixin2to3(ulogcBs/|EeZdZdZd8d9d:d;d<gZdd
gZidd6Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7S(=ubuild_pyu5"build" pure Python modules (copy to build directory)u
build-lib=ududirectory to "build" (copy) toucompileucucompile .py to .pycu
no-compileu!don't compile .py files [default]u	optimize=uOulalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]uforceufu2forcibly build everything (ignore file timestamps)cCsLd|_d|_d|_d|_d|_d|_d|_d|_dS(Ni(	uNoneu	build_libu
py_modulesupackageupackage_dataupackage_dirucompileuoptimizeuforce(uself((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyuinitialize_options s							ubuild_py.initialize_optionscCs|jddd�|jj|_|jj|_|jj|_i|_|jjr�x6|jjj�D]\}}t|�|j|<qhWn|j�|_	t
|jt�sy;t|j�|_d|jko�dkns�t
�Wqtt
fk
rtd��YqXndS(	Nubuildu	build_libuforceiiuoptimize must be 0, 1, or 2(u	build_libu	build_lib(uforceuforce(uset_undefined_optionsudistributionupackagesu
py_modulesupackage_dataupackage_diruitemsuconvert_pathuget_data_filesu
data_filesu
isinstanceuoptimizeuintuAssertionErroru
ValueErroruDistutilsOptionError(uselfunameupath((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyufinalize_options*s"		)ubuild_py.finalize_optionscCsS|jr|j�n|jr6|j�|j�n|j|jdd��dS(Nuinclude_bytecodei(u
py_modulesu
build_modulesupackagesubuild_packagesubuild_package_dataubyte_compileuget_outputs(uself((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyurunCs	
	

ubuild_py.runcs�g}|js|Sx�|jD]�}|j|�}tjj|jg|jd��}d�|rvt|�d�n�fdd�|j||�D�}|j	||||f�qW|S(u?Generate list of '(package,src_dir,build_dir,filenames)' tuplesu.iics g|]}|�d��qS(N((u.0ufile(uplen(u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyu
<listcomp>ts	u+build_py.get_data_files.<locals>.<listcomp>(
upackagesuget_package_diruosupathujoinu	build_libusplitulenufind_data_filesuappend(uselfudataupackageusrc_diru	build_diru	filenames((uplenu?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyuget_data_filesas	%%ubuild_py.get_data_filescs�|jjdg�|jj|g�}g�xO|D]G}ttjj|t|���}�j�fdd�|D��q5W�S(u6Return filenames for package's data files in 'src_dir'ucs4g|]*}|�krtjj|�r|�qS((uosupathuisfile(u.0ufn(ufiles(u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyu
<listcomp>�s	u,build_py.find_data_files.<locals>.<listcomp>(upackage_dataugetuglobuosupathujoinuconvert_pathuextend(uselfupackageusrc_diruglobsupatternufilelist((ufilesu?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyufind_data_filesys
!$ubuild_py.find_data_filescCs�d}x�|jD]v\}}}}xa|D]Y}tjj||�}|jtjj|��|jtjj||�|dd�q)WqWdS(u$Copy data files into build directoryu
preserve_modeNF(	uNoneu
data_filesuosupathujoinumkpathudirnameu	copy_fileuFalse(uselfulastdirupackageusrc_diru	build_diru	filenamesufilenameutarget((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyubuild_package_data�s
ubuild_py.build_package_datacCs|jd�}|js5|r.tjj|�SdSn�g}x�|r�y|jdj|�}Wn-tk
r�|jd|d�|d=Yq>X|jd|�tjj|�Sq>W|jjd�}|dk	r�|jd|�n|r�tjj|�SdSdS(u�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).u.uiiNi����i����(	usplitupackage_diruosupathujoinuKeyErroruinsertugetuNone(uselfupackageupathutailupdir((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyuget_package_dir�s(		
	ubuild_py.get_package_dircCs�|dkrYtjj|�s1td|��ntjj|�sYtd|��qYn|r�tjj|d�}tjj|�r�|Stjdd|�ndS(Nuu%package directory '%s' does not existu>supposed package directory '%s' exists, but is not a directoryu__init__.pyu!package init file '%s' not found u(or not a regular file)(
uosupathuexistsuDistutilsFileErroruisdirujoinuisfileuloguwarnuNone(uselfupackageupackage_diruinit_py((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyu
check_package�s	ubuild_py.check_packagecCs1tjj|�s)tjd||�dSdSdS(Nu!file %s (for module %s) not foundFT(uosupathuisfileuloguwarnuFalseuTrue(uselfumoduleumodule_file((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyucheck_module�subuild_py.check_modulec	Cs�|j||�ttjj|d��}g}tjj|jj�}xx|D]p}tjj|�}||kr�tjjtjj	|��d}|j
|||f�qP|jd|�qPW|S(Nu*.pyiuexcluding %s(u
check_packageuglobuosupathujoinuabspathudistributionuscript_nameusplitextubasenameuappendudebug_print(	uselfupackageupackage_dirumodule_filesumodulesusetup_scriptufuabs_fumodule((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyufind_package_modules�s
"ubuild_py.find_package_modulesc
Cs%i}g}x|jD]}|jd�}dj|dd��}|d}y||\}}Wn'tk
r�|j|�}d}YnX|s�|j||�}	|df||<|	r�|j|d|	f�q�ntjj||d�}
|j	||
�sqn|j|||
f�qW|S(u�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.
        u.iiu__init__u.pyi����i����(
u
py_modulesusplitujoinuKeyErroruget_package_diru
check_packageuappenduosupathucheck_module(uselfupackagesumodulesumoduleupathupackageumodule_baseupackage_dirucheckeduinit_pyumodule_file((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyufind_modules�s*

ubuild_py.find_modulescCswg}|jr%|j|j��n|jrsxB|jD]4}|j|�}|j||�}|j|�q8Wn|S(u4Compute 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.(u
py_modulesuextendufind_modulesupackagesuget_package_dirufind_package_modules(uselfumodulesupackageupackage_dirum((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyufind_all_moduless		ubuild_py.find_all_modulescCsdd�|j�D�S(NcSsg|]}|d�qS(ii����((u.0umodule((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyu
<listcomp>-s	u-build_py.get_source_files.<locals>.<listcomp>(ufind_all_modules(uself((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyuget_source_files,subuild_py.get_source_filescCs.|gt|�|dg}tjj|�S(Nu.py(ulistuosupathujoin(uselfu	build_dirupackageumoduleuoutfile_path((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyuget_module_outfile/subuild_py.get_module_outfileicCs�|j�}g}x�|D]�\}}}|jd�}|j|j||�}|j|�|r|jr�|jtj|dd��n|j	dkr�|jtj|dd��q�qqW|dd�|jD�7}|S(Nu.udebug_overrideicSs>g|]4\}}}}|D]}tjj||��qqS((uosupathujoin(u.0upackageusrc_diru	build_diru	filenamesufilename((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyu
<listcomp>Cs	u(build_py.get_outputs.<locals>.<listcomp>TF(ufind_all_modulesusplituget_module_outfileu	build_libuappenducompileuimpucache_from_sourceuTrueuoptimizeuFalseu
data_files(uselfuinclude_bytecodeumodulesuoutputsupackageumoduleumodule_fileufilename((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyuget_outputs3s"
	
	ubuild_py.get_outputscCs�t|t�r!|jd�}n$t|ttf�sEtd��n|j|j||�}tj	j
|�}|j|�|j||dd�S(Nu.u:'package' must be a string (dot-separated), list, or tupleu
preserve_modei(
u
isinstanceustrusplitulistutupleu	TypeErroruget_module_outfileu	build_libuosupathudirnameumkpathu	copy_file(uselfumoduleumodule_fileupackageuoutfileudir((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyubuild_moduleJs
ubuild_py.build_modulecCs=|j�}x*|D]"\}}}|j|||�qWdS(N(ufind_modulesubuild_module(uselfumodulesupackageumoduleumodule_file((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyu
build_modulesYsubuild_py.build_modulescCsxxq|jD]f}|j|�}|j||�}x<|D]4\}}}||ksYt�|j|||�q8Wq
WdS(N(upackagesuget_package_dirufind_package_modulesuAssertionErrorubuild_module(uselfupackageupackage_dirumodulesupackage_umoduleumodule_file((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyubuild_packagesbs
ubuild_py.build_packagesc
Cs�tjr|jd�dSddlm}|j}|d	tjkrV|tj}n|jr�||ddd|j	d|d|j
�n|jdkr�||d|jd|j	d|d|j
�ndS(
Nu%byte-compiling is disabled, skipping.i(ubyte_compileiuoptimizeuforceuprefixudry_runi����(usysudont_write_bytecodeuwarnudistutils.utilubyte_compileu	build_libuosusepucompileuforceudry_runuoptimize(uselfufilesubyte_compileuprefix((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyubyte_compilevs	
		ubuild_py.byte_compileN(u
build-lib=ududirectory to "build" (copy) to(ucompileucucompile .py to .pyc(u
no-compileNu!don't compile .py files [default](u	optimize=uOulalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0](uforceufu2forcibly build everything (ignore file timestamps)(u__name__u
__module__u__qualname__udescriptionuNoneuuser_optionsuboolean_optionsunegative_optuinitialize_optionsufinalize_optionsurunuget_data_filesufind_data_filesubuild_package_datauget_package_diru
check_packageucheck_moduleufind_package_modulesufind_modulesufind_all_modulesuget_source_filesuget_module_outfileuget_outputsubuild_moduleu
build_modulesubuild_packagesubyte_compile(u
__locals__((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyubuild_pys8	



'4	ubuild_pycBs,|EeZdZdd�Zdd�ZdS(u
build_py_2to3cCslg|_|jr|j�n|jr?|j�|j�n|j|j�|j|jdd��dS(Nuinclude_bytecodei(	u
updated_filesu
py_modulesu
build_modulesupackagesubuild_packagesubuild_package_dataurun_2to3ubyte_compileuget_outputs(uself((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyurun�s		
	

ubuild_py_2to3.runcCs=tj||||�}|dr9|jj|d�n|S(Nii(ubuild_pyubuild_moduleu
updated_filesuappend(uselfumoduleumodule_fileupackageures((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyubuild_module�s
ubuild_py_2to3.build_moduleN(u__name__u
__module__u__qualname__urunubuild_module(u
__locals__((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyu
build_py_2to3�su
build_py_2to3(u__doc__uosuimpusysuglobudistutils.coreuCommandudistutils.errorsudistutils.utiluconvert_pathu	Mixin2to3u	distutilsulogubuild_pyu
build_py_2to3(((u?/opt/alt/python33/lib64/python3.3/distutils/command/build_py.pyu<module>s
�|

?>