Edit File: build_py.pyc
� ��7ec�����������@���s����d��Z��d�Z�d�d�l�Z�d�d�l�Z�d�d�l�m�Z�d�d�l�m�Z�d�d�l�m�Z�m �Z �d�d�l �m�Z�d�d�l�m �Z �d �e�f�d �������YZ�d�S(���sH���distutils.command.build_py Implements the Distutils 'build_py' command.s���$Id$i����N(���t���glob(���t���Command(���t���DistutilsOptionErrort���DistutilsFileError(���t���convert_path(���t���logt���build_pyc�����������B���s����e��Z�d��Z�d#�d$�d&�d'�d(�g�Z�d�d�g�Z�i�d�d�6Z�d����Z�d����Z�d����Z �d����Z �d����Z�d����Z�d����Z �d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d�d���Z�d����Z�d ����Z�d!����Z�d"����Z�RS()���s5���"build" pure Python modules (copy to build directory)s ���build-lib=t���ds���directory to "build" (copy) tot���compilet���cs���compile .py to .pycs ���no-compiles!���don't compile .py files [default]s ���optimize=t���Osl���also compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]t���forcet���fs2���forcibly build everything (ignore file timestamps)c���������C���sL���d��|��_�d��|��_�d��|��_�d��|��_�d��|��_�d�|��_�d�|��_�d��|��_�d��S(���Ni����( ���t���Nonet ���build_libt ���py_modulest���packaget���package_datat���package_dirR���t���optimizeR���(���t���self(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���initialize_options!���s���� c���������C���s��|��j��d�d�d���|��j�j�|��_�|��j�j�|��_�|��j�j�|��_�i��|��_�|��j�j�r��x6�|��j�j�j����D]�\�}�}�t�|���|��j�|�<qh�Wn��|��j����|��_ �t �|��j�t���sy;�t�|��j���|��_�d�|��j�k�o��d�k�n�s��t ���Wqt�t �f�k �rt�d�����qXn��d��S( ���Nt���buildR���R���i����i���s���optimize must be 0, 1, or 2(���R���R���(���R���R���(���t���set_undefined_optionst���distributiont���packagesR���R���R���t���itemsR���t���get_data_filest ���data_filest ���isinstanceR���t���intt���AssertionErrort ���ValueErrorR���(���R���t���namet���path(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���finalize_options+���s"���� )c���������C���sS���|��j��r�|��j����n��|��j�r6�|��j����|��j����n��|��j�|��j�d�d�����d��S(���Nt���include_bytecodei����(���R���t ���build_modulesR���t���build_packagest���build_package_datat���byte_compilet���get_outputs(���R���(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���runD���s���� c���������C���s����g��}�|��j��s�|�Sx��|��j��D]��}�|��j�|���}�t�j�j�|��j�g�|�j�d������}�d�}�|�rv�t�|���d�}�n��g��|��j�|�|���D]�}�|�|�^�q��}�|�j �|�|�|�|�f���q�W|�S(���s?���Generate list of '(package,src_dir,build_dir,filenames)' tuplest���.i����i���( ���R���t���get_package_dirt���osR"���t���joinR���t���splitt���lent���find_data_filest���append(���R���t���dataR���t���src_dirt ���build_dirt���plent���filet ���filenames(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyR���b���s���� %)c���������C���s����|��j��j�d�g����|��j��j�|�g����}�g��}�xm�|�D]e�}�t�t�j�j�|�t�|�������}�|�j�g��|�D]*�}�|�|�k�ri�t�j�j�|���ri�|�^�qi���q5�W|�S(���s6���Return filenames for package's data files in 'src_dir't����( ���R���t���getR����R-���R"���R.���R���t���extendt���isfile(���R���R���R4���t���globst���filest���patternt���filelistt���fn(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyR1���z���s���� !#c���������C���s����x��|��j��D]v�\�}�}�}�}�xa�|�D]Y�}�t�j�j�|�|���}�|��j�t�j�j�|�����|��j�t�j�j�|�|���|�d�t��q#�Wq �Wd�S(���s$���Copy data files into build directoryt ���preserve_modeN(���R���R-���R"���R.���t���mkpatht���dirnamet ���copy_filet���False(���R���R���R4���R5���R8���t���filenamet���target(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyR'�������s���� c���������C���s���|�j��d���}�|��j�s5�|�r.�t�j�j�|����Sd�Sn��g��}�x��|�r��y�|��j�d�j�|���}�Wn,�t�k �r��|�j�d�|�d���|�d�=q>�X|�j�d�|���t�j�j�|����Sq>�W|��j�j�d���}�|�d�k �r��|�j�d�|���n��|�r��t�j�j�|����Sd�Sd�S(���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+���R9���i����i����N( ���R/���R���R-���R"���R.���t���KeyErrort���insertR:���R ���(���R���R���R"���t���tailt���pdir(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyR,�������s(���� c���������C���s����|�d�k�rY�t��j�j�|���s1�t�d�|�����n��t��j�j�|���sY�t�d�|�����qY�n��|�r��t��j�j�|�d���}�t��j�j�|���r��|�St�j�d�d�|���n��d��S(���NR9���s%���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"���t���existsR���t���isdirR.���R<���R���t���warnR ���(���R���R���R���t���init_py(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt ���check_package����s���� c���������C���s1���t��j�j�|���s)�t�j�d�|�|���t�St�Sd��S(���Ns!���file %s (for module %s) not found(���R-���R"���R<���R���RO���RF���t���True(���R���t���modulet���module_file(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���check_module����s����c��� ������C���s����|��j��|�|���t�t�j�j�|�d�����}�g��}�t�j�j�|��j�j���}�xx�|�D]p�}�t�j�j�|���}�|�|�k�r��t�j�j�t�j�j �|�����d�}�|�j �|�|�|�f���qP�|��j�d�|���qP�W|�S(���Ns���*.pyi����s���excluding %s(���RQ���R����R-���R"���R.���t���abspathR���t���script_namet���splitextt���basenameR2���t���debug_print( ���R���R���R���t���module_filest���modulest���setup_scriptR���t���abs_fRS���(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���find_package_modules����s���� "c���������C���s!��i��}�g��}�x|��j��D]}�|�j�d���}�d�j�|�d�d�!��}�|�d�}�y�|�|�\�}�}�Wn&�t�k �r��|��j�|���}�d�}�n�X|�s��|��j�|�|���} �|�d�f�|�|�<| �r��|�j�|�d�| �f���q��n��t�j�j�|�|�d���} �|��j �|�| ���sq�n��|�j�|�|�| �f���q�W|�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+���i����i����i���t���__init__s���.py( ���R���R/���R.���RI���R,���RQ���R2���R-���R"���RU���(���R���R���R\���RS���R"���R���t���module_baseR���t���checkedRP���RT���(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���find_modules����s*���� c���������C���sw���g��}�|��j��r%�|�j�|��j������n��|��j�rs�xB�|��j�D]4�}�|��j�|���}�|��j�|�|���}�|�j�|���q8�Wn��|�S(���s4��Compute 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.(���R���R;���Rc���R���R,���R_���(���R���R\���R���R���t���m(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���find_all_modules��s���� c���������C���s!���g��|��j�����D]�}�|�d�^�q �S(���Ni����(���Re���(���R���RS���(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���get_source_files-��s����c���������C���s.���|�g�t��|���|�d�g�}�t�j�j�|����S(���Ns���.py(���t���listR-���R"���R.���(���R���R5���R���RS���t���outfile_path(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���get_module_outfile0��s����i���c���������C���s����|��j�����}�g��}�x��|�D]��\�}�}�}�|�j�d���}�|��j�|��j�|�|���}�|�j�|���|�r�|��j�r�|�j�|�d���n��|��j�d�k�r��|�j�|�d���q��q�q�W|�g��|��j�D]4�\�}�}�} �} �| �D]�}�t�j �j �| �|���^�q��q��7}�|�S(���NR+���R ���i����t���o(���Re���R/���Ri���R���R2���R���R���R���R-���R"���R.���(���R���R$���R\���t���outputsR���RS���RT���RG���R4���R5���R8���(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyR)���4��s ���� )c���������C���s����t��|�t���r!�|�j�d���}�n$�t��|�t�t�f���sE�t�d�����n��|��j�|��j�|�|���}�t�j �j �|���}�|��j�|���|��j�|�|�d�d��S(���NR+���s:���'package' must be a string (dot-separated), list, or tupleRB���i����( ���R���t���strR/���Rg���t���tuplet ���TypeErrorRi���R���R-���R"���RD���RC���RE���(���R���RS���RT���R���t���outfilet���dir(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���build_moduleI��s���� c���������C���s=���|��j�����}�x*�|�D]"�\�}�}�}�|��j�|�|�|���q�Wd��S(���N(���Rc���Rq���(���R���R\���R���RS���RT���(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyR%���X��s����c���������C���sx���xq�|��j��D]f�}�|��j�|���}�|��j�|�|���}�x<�|�D]4�\�}�}�}�|�|�k�sY�t���|��j�|�|�|���q8�Wq �Wd��S(���N(���R���R,���R_���R���Rq���(���R���R���R���R\���t���package_RS���RT���(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyR&���b��s����c������ ���C���s����t��j�r�|��j�d���d��Sd�d�l�m�}�|��j�}�|�d�t�j�k�rV�|�t�j�}�n��|��j�r��|�|�d�d�d�|��j �d�|�d�|��j ��n��|��j�d�k�r��|�|�d�|��j�d�|��j �d�|�d�|��j ��n��d��S( ���Ns%���byte-compiling is disabled, skipping.i����(���R(���R���i����R���t���prefixt���dry_run(���t���syst���dont_write_bytecodeRO���t���distutils.utilR(���R���R-���t���sepR���R���Rt���R���(���R���R>���R(���Rs���(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyR(���w��s���� (���s ���build-lib=R���s���directory to "build" (copy) to(���R���R ���s���compile .py to .pycN(���s ���no-compileNs!���don't compile .py files [default](���s ���optimize=R ���sl���also compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0](���R���R���s2���forcibly build everything (ignore file timestamps)(���t���__name__t ���__module__t���descriptionR ���t���user_optionst���boolean_optionst���negative_optR���R#���R*���R���R1���R'���R,���RQ���RU���R_���Rc���Re���Rf���Ri���R)���Rq���R%���R&���R(���(����(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyR������s8���� ( 4 (���t���__doc__t���__revision__R-���Ru���R����t���distutils.coreR���t���distutils.errorsR���R���Rw���R���t ���distutilsR���R���(����(����(����s2���/usr/lib64/python2.7/distutils/command/build_py.pyt���<module>���s���