ó Àfc@sddlmZddlmZddljjZddlZddlZddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZmZyddlmZWn$ek ràdd d„ƒYZnXd ejefd „ƒYZdd „Zd „ZdS(iÿÿÿÿ(tglob(t convert_pathN(tsix(tmaptfiltert filterfalse(t Mixin2to3RcBseZed„ZRS(cCsdS(s do nothingN((tselftfilestdoctests((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pytrun_2to3t(t__name__t __module__tTrueR (((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRstbuild_pycBs›eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zed„ƒ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. cCsftjj|ƒ|jj|_|jjp.i|_d|jkrP|jd=ng|_g|_dS(Nt data_files( torigRtfinalize_optionst distributiont 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.pyR!s    cCsª|j r|j rdS|jr.|jƒn|jrN|jƒ|jƒn|j|jtƒ|j|jtƒ|j|j tƒ|j t j j |ddƒƒdS(s?Build modules, packages, and copy data files to build directoryNtinclude_bytecodei(t py_modulestpackagest build_modulestbuild_packagestbuild_package_dataR RtFalseRRt byte_compileRRt get_outputs(R((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pytrun+s     cCs5|dkr"|jƒ|_|jStjj||ƒS(slazily compute data filesR(t_get_data_filesRRRt __getattr__(Rtattr((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR$?s cCsqtjr-t|tjƒr-|jdƒ}ntjj||||ƒ\}}|rg|jj |ƒn||fS(Nt.( RtPY2t isinstancet string_typestsplitRRt build_moduleRtappend(Rtmodulet module_filetpackagetoutfiletcopied((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR+FscCs)|jƒtt|j|jp"dƒƒS(s?Generate list of '(package,src_dir,build_dir,filenames)' tuples((tanalyze_manifesttlistRt_get_pkg_data_filesR(R((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR#Ps cCsx|j|ƒ}tjj|jg|jdƒŒ}g|j||ƒD]}tjj||ƒ^qG}||||fS(NR&(tget_package_dirtostpathtjoint build_libR*tfind_data_filestrelpath(RR/tsrc_dirt build_dirtfilet filenames((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR4Us %1cCs‚|j|j||ƒ}tt|ƒ}tjj|ƒ}ttj j |ƒ}tj|j j |gƒ|ƒ}|j |||ƒS(s6Return filenames for package's data files in 'src_dir'(t_get_platform_patternsRRRt itertoolstchaint from_iterableRR6R7tisfiletmanifest_filestgettexclude_data_files(RR/R<tpatternstglobs_expandedt globs_matchest glob_filesR((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR:cs  c CsÍxÆ|jD]»\}}}}x¦|D]ž}tjj||ƒ}|jtjj|ƒƒtjj||ƒ}|j||ƒ\}} tjj|ƒ}| r#||jj kr#|j j |ƒq#q#Wq WdS(s$Copy data files into build directoryN( RR6R7R8tmkpathtdirnamet copy_filetabspathRtconvert_2to3_doctestsRR,( RR/R<R=R?tfilenamettargettsrcfiletoutfR1((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRts c Cs\i|_}|jjsdSi}x0|jp2dD]}||t|j|ƒƒÍsc3s!|]}|ˆkr|VqdS(N((R|tfn(tbad(s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pys Ôs(R3R@RRARBRCtsett_unique_everseen(RR/R<RRHt match_groupstmatchestkeepers((RRs?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRGÄs       cs>tj|jdgƒ|j|gƒƒ}‡fd†|DƒS(sÜ yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. R c3s*|] }tjjˆt|ƒƒVqdS(N(R6R7R8R(R|R}(R<(s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pys és(RARBRF(tspecR/R<t raw_patterns((R<s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR@Ûs  (R R t__doc__RR"R$R+R#R4R:RR2RfRkRxR5RGt staticmethodR@(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRs            ccsŒtƒ}|j}|dkrMxgt|j|ƒD]}||ƒ|Vq1Wn;x8|D]0}||ƒ}||krT||ƒ|VqTqTWdS(sHList unique elements, preserving order. Remember all elements ever seen.N(R€taddR[Rt __contains__(titerabletkeytseentseen_addtelementtk((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRïs         cCsOtjj|ƒs|Sddlm}tjdƒjƒ|}||ƒ‚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. (R6R7tisabstdistutils.errorsR‘ttextwraptdedenttlstrip(R7R‘tmsg((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRWs ((Rtdistutils.utilRtdistutils.command.build_pytcommandRRR6R{R”RnR“RqRAtsetuptools.externRtsetuptools.extern.six.movesRRRtsetuptools.lib2to3_exRt ImportErrorR[RRW(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyts"       Ø