ó ‹Ägc@sddlZddlZddlZddlmZddlmZddl m Z yrddlm Z ddl m Z ddlmZmZddlZdefd „ƒYZd e fd „ƒYZ Wn$ek rìd dd „ƒYZ nXd ee fd„ƒYZd„ZdS(iÿÿÿÿN(tbuild_py(t convert_path(tglob(t Mixin2to3(tlog(tRefactoringTooltget_fixers_from_packagetDistutilsRefactoringToolcBs#eZd„Zd„Zd„ZRS(cOstj||ŒdS(N(Rterror(tselftmsgtargstkw((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyt log_error scGstj||ŒdS(N(Rtinfo(R R R ((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyt log_messagescGstj||ŒdS(N(Rtdebug(R R R ((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyt log_debugs(t__name__t __module__R RR(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR s  RcBs&eZed„Zd„Zd„ZRS(cCsŸ|jjtk rdS|s dStjddj|ƒƒ|jƒ|jƒ|r‹tj r›t |j ƒ}|j |dtdtƒq›nt j||ƒdS(NsFixing t twritet doctests_only(t distributiontuse_2to3tTrueRRtjoint_Mixin2to3__build_fixer_namest_Mixin2to3__exclude_fixerst setuptoolstrun_2to3_on_doctestsRt fixer_namestrefactort _Mixin2to3trun_2to3(R tfilestdocteststr((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR"s   cCs†|jr dSg|_x'tjD]}|jjt|ƒƒq W|jjdk r‚x-|jjD]}|jjt|ƒƒq_WndS(N(RRtlib2to3_fixer_packagestextendRRtuse_2to3_fixerstNone(R tp((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyt__build_fixer_names(s  cCsqt|dgƒ}|jjdk r:|j|jjƒnx0|D](}||jkrA|jj|ƒqAqAWdS(Ntexclude_fixers(tgetattrRtuse_2to3_exclude_fixersR)R'Rtremove(R texcluded_fixerst fixer_name((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyt__exclude_fixers1s  (RRtFalseR"RR(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRs  cBseZed„ZRS(cCsdS(N((R R#R$((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR";s(RRRR"(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR:sRcBs¡eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z e j d kr{d d „Znd „Zd„Zd„Zd„ZRS(sXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCsctj|ƒ|jj|_|jjp+i|_d|jkrM|jd=ng|_g|_dS(Nt data_files(t _build_pytfinalize_optionsRt package_datatexclude_package_datat__dict__t_build_py__updated_filest_build_py__doctests_2to3(R ((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR6Hs   cCs§|j r|j rdS|jr.|jƒn|jrN|jƒ|jƒn|j|jtƒ|j|jtƒ|j|j tƒ|j t j |ddƒƒdS(s?Build modules, packages, and copy data files to build directoryNtinclude_bytecodei( t py_modulestpackagest build_modulestbuild_packagestbuild_package_dataR"R:R3RR;t byte_compileR5t get_outputs(R ((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pytrunPs     cCs3|dkr#|jƒ|_}|Stj||ƒS(NR4(t_get_data_filesR4R5t __getattr__(R tattrR#((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRFds cCsAtj||||ƒ\}}|r7|jj|ƒn||fS(N(R5t build_moduleR:tappend(R tmodulet module_filetpackagetoutfiletcopied((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRHiscCsÃ|jƒg}x¬|jpdD]›}|j|ƒ}tjj|jg|jdƒŒ}t|ƒ}|ry|d7}ng|j ||ƒD]}||^qŒ}|j ||||fƒq W|S(s?Generate list of '(package,src_dir,build_dir,filenames)' tuplest.i(( tanalyze_manifestR>tget_package_dirtostpathRt build_libtsplittlentfind_data_filesRI(R tdataRLtsrc_dirt build_dirtplentfilet filenames((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyREos %  )cCsŠ|jjdgƒ|jj|gƒ}|jj|gƒ}x6|D].}|jttjj|t|ƒƒƒƒqEW|j |||ƒS(s6Return filenames for package's data files in 'src_dir't( R7tgettmanifest_filesR'RRRRSRRtexclude_data_files(R RLRYtglobsR#tpattern((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRW‡s  ,c CsÓd}xÆ|jD]»\}}}}x¦|D]ž}tjj||ƒ}|jtjj|ƒƒtjj||ƒ}|j||ƒ\} } tjj|ƒ}| r)||j j kr)|j j | ƒq)q)WqWdS(s$Copy data files into build directoryN( R)R4RRRSRtmkpathtdirnamet copy_filetabspathRtconvert_2to3_doctestsR;RI( R tlastdirRLRYRZR]tfilenamettargettsrcfiletoutfRN((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRA‘s c Cs\i|_}|jjsdSi}x0|jp2dD]}||t|j|ƒƒtassert_relativeRQt run_commandtget_finalized_commandtfilelistR#RRRSRUR)Rtendswitht setdefaultRI( R tmftsrc_dirsRLtei_cmdRStdtftprevtoldftdf((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRPŸs(   ! cCsdS(N((R ((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pytget_data_files·ss2.4icCsRtj||ƒg|jD]4\}}}}|D]}tjj||ƒ^q/qS(sjReturn complete list of files copied to the build directory This includes both '.py' files and data files, as well as '.pyc' and '.pyo' files if 'include_bytecode' is true. (This method is needed for the 'install_lib' command to do its job properly, and to generate a correct installation manifest.) (R5RCR4RRRSR(R R<RLRYRZR]Rj((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRCºscCsóy|j|SWntk r"nXtj|||ƒ}||j|<| sY|jj r]|Sx;|jjD])}||ks|j|dƒrjPqjqjW|St|dƒ}djƒ|j ƒkråddl m }|j d|ƒn|j ƒ|S(s8Check namespace packages' __init__ for declare_namespaceROtrbUtdeclare_namespaceiÿÿÿÿ(Rs¼WARNING: %s is a namespace package, but its __init__.py does not declare_namespace(); setuptools 0.7 will REQUIRE this! (See the setuptools manual under "Namespace Packages" for details.) (tpackages_checkedtKeyErrorR5t check_packageRtnamespace_packagest startswithtopentencodetreadt distutilsRtwarntclose(R RLt package_dirtinit_pytpkgRzR((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRƒÈs(    cCsi|_tj|ƒdS(N(RR5tinitialize_options(R ((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRçs cCsAtj||ƒ}|jjdk r=tjj|jj|ƒS|S(N(R5RQRtsrc_rootR)RRRSR(R RLtres((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRQìsc CsÃ|jjdgƒ|jj|gƒ}g}x<|D]4}|jtj|tjj|t|ƒƒƒƒq5Wt j |ƒ}i}g|D]6}||kr‰||kr‰|j |dƒr‰|^q‰S(s6Filter filenames for package's data files in 'src_dir'R^i( R8R_R'tfnmatchtfilterRRRSRRtdicttfromkeysRu( R RLRYR#RbtbadRctseenRz((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRaós &(RRt__doc__R6RDRFRHRERWRARPR~tsystversionRCRƒRRQRa(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR?s            cCs:tjj|ƒs|Sddlm}|d|ƒ‚dS(Niÿÿÿÿ(tDistutilsSetupErrorsªError: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. (RRRStisabstdistutils.errorsR›(RSR›((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRps ((tos.pathRRR™R’tdistutils.command.build_pyRR5tdistutils.utilRRRR!R‰Rtlib2to3.refactorRRRRt ImportErrorRp(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyts$  # Ç