b-Qc@sdZddlZddlZddlZddlmZddlmZmZy#ddl m Z m Z dZ Wn0e k rddlmZm Z dZ nXdd lmZdd lmZdd lmZmZmZdd lmZdd lmZddlmZmZddlmZdZ dZ!dZ"defdYZ#e$j%dj&Z'dZ(dZ)dZ*ide+6de,6Z-dZ.dZ/dZ0ddd d!gZ1d"d"e2d#d$Z3dS(%s6setuptools.command.bdist_egg Build .egg distributionsiN(tCommand(t remove_treetmkpath(tget_pathtget_python_versioncCs tdS(Ntpurelib(R(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt _get_purelib s(tget_python_libRcCs ttS(N(RtFalse(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs(tlog(tDistutilsSetupError(tget_build_platformt Distributiontensure_directory(t EntryPoint(tCodeType(t basestringtnext(tLibrarycCsEd|kr%tjj|d}n|jdrA|d }n|S(Nt.itmodulei(tostpathtsplitexttendswith(tfilename((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt strip_modules   c CsOt|d}|jdjdddd|ddd d g|jdS( Ntws sdef __bootstrap__():s- global __bootstrap__, __loader__, __file__s! import sys, pkg_resources, imps: __file__ = pkg_resources.resource_filename(__name__,%r)s3 __loader__ = None; del __bootstrap__, __loader__s& imp.load_dynamic(__name__,__file__)s__bootstrap__()t(topentwritetjointclose(tresourcetpyfiletf((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt write_stub"s  s7__import__("pkg_resources").declare_namespace(__name__)t bdist_eggcBseZdZddddefd d d d d fd!d"gZd ddgZdZdZdZ dZ dZ dZ dZ dZdZdZdZdZRS(#screate an "egg" distributions bdist-dir=tbs1temporary directory for creating the distributions plat-name=tps;platform name to embed in generated filenames (default: %s)sexclude-source-filess+remove all .py files from the generated eggs keep-temptks/keep the pseudo-installation tree around after s!creating the distribution archives dist-dir=tds-directory to put final built distributions ins skip-builds2skip rebuilding everything (for testing/debugging)cCsCd|_d|_d|_d|_d|_d|_d|_dS(Ni(tNonet bdist_dirt plat_namet keep_temptdist_dirt skip_buildt egg_outputtexclude_source_files(tself((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytinitialize_options]s      cCs|jd}|_|j|_|jdkr^|jdj}tjj|d|_n|j dkr|t |_ n|j dd|j dkrt dd|j|jt|jjo|j j}tjj|j|d|_ ndS(Ntegg_infotbdistteggR.s.egg(sdist_dirsdist_dir(tget_finalized_commandtei_cmdR4R+R*t bdist_baseRRRR,R tset_undefined_optionsR0R tegg_namet egg_versionRt distributionthas_ext_modulesR.(R2R8R9tbasename((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytfinalize_optionsgs !cCs`|j|jd_tjjtjjt}|jj g}|j_ x|D]}t |t rt |dkrtjj |drtjj|d}tjj|}||ks|j|tjr|t |d|df}qqn|jj j|qVWz1tjd|j|jdddddWd||j_ XdS( Ntinstalliiisinstalling package data to %st install_datatforcetroot(R+R7t install_libRRtnormcasetrealpathRR=t data_filest isinstancettupletlentisabst startswithtseptappendR tinfot call_commandR*(R2t site_packagestoldtitemRGt normalized((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytdo_install_datas ! !'cCs |jgS(N(R0(R2((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt get_outputsscKsmx!tD]}|j||jqW|jd|j|jd|j|j||}|j||S(s8Invoke reinitialized command `cmdname` with keyword argsR/tdry_run(tINSTALL_DIRECTORY_ATTRSt setdefaultR+R/RXtreinitialize_commandt run_command(R2tcmdnametkwtdirnametcmd((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRQs  c Cs|jdtjd|j|jd}|j}d|_|jjrk|j rk|jdn|j ddd}||_|j \}}g|_ g}xt |D]\}}tjj|\} } tjj|jt| d} |j j| tjd ||jsCttjj|| n|j| |jtjd ||R7t extensionsRIRtget_ext_fullnameRtget_ext_filenameR?RMRy( R2RRtpathsRRRRt build_cmdRtfullname((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRm_s(" " -$(s bdist-dir=R&s1temporary directory for creating the distributionN(sexclude-source-filesNs+remove all .py files from the generated egg(s dist-dir=R)s-directory to put final built distributions in(s skip-buildNs2skip rebuilding everything (for testing/debugging)(t__name__t __module__t descriptionR R*t user_optionstboolean_optionsR3R@RVRWRQRR{RxRrR}RtRm(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR%4s8      R   ) s.dll .so .dylib .pydccshtj|}t|\}}}d|kr@|jdn|||fVx|D] }|VqUWdS(s@Walk an unpacked egg's contents, skipping the metadata directorysEGG-INFON(RRRtremove(tegg_dirtwalkerRRRtbdf((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs  c CsxBtjD]4\}}tjjtjj|d|r |Sq WtsRtSt}xt |D]\}}}xn|D]f}|j ds{|j drq{q{|j ds|j dr{t ||||o|}q{q{WqeW|S(NsEGG-INFOs.pys.pyws.pycs.pyo( t safety_flagstitemsRRRyRtcan_scanRtTrueRRt scan_module( RRntflagtfnRRRRR((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs$  &cCsxtjD]\}}tjj||}tjj|rq|dks^t||krtj|qq |dk r t||kr t |d}|j d|j q q WdS(NRhs ( RRRRRRyR*tboolRvRRR (RRRRR#((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRws szip-safes not-zip-safec Cstjj||}|d |kr)tS|t|djtjd}||r[dp^dtjj|d}tj dkrd}nd}t |d }|j |t j |} |jt} tjt| } x<d d gD].} | | krtjd || t} qqWd | krxZdddddddddddg D].} | | krWtjd|| t} qWqWWnd| krd| krd|krtjd dkrtjd|t} qn| S(s;Check whether module possibly uses unsafe-for-zipfile stuffiiRRiiii trbt__file__t__path__s%s: module references %stinspectt getsourcet getabsfilet getsourcefiletgetfilegetsourcelinest findsourcet getcommentst getframeinfotgetinnerframestgetouterframeststackttraces"%s: module MAY be using inspect.%sRt__main__s2.4s.%s: top-level module may be 'python -m' script(ii(RRRRRKRpRNRRt version_infoRtreadtmarshaltloadR tdicttfromkeyst iter_symbolsR RzRR( RRRRnRRRtskipR#tcodeRtsymbolstbad((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs>#*         $ ccsvx|jD] }|Vq WxV|jD]K}t|tr@|Vq#t|tr#xt|D] }|Vq\Wq#q#WdS(sBYield names and strings used by `code` and its nested code objectsN(tco_namest co_constsRIRRR(RRtconst((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs cCsDtjjd r&tjdkr&tStjdtjddS(Ntjavatclis1Unable to analyze compiled code on this platform.sfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.py(RtplatformRMRR Rz(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs" RERfRBt install_baseiRc sddl}ttjj|dtjd|fd}|dkrktj dk}n|j |j gt |}s|j ||d|} x0tjD]\} } } || | | qW| jn3x0tjD]\} } } |d| | qW|S(sqCreate a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. iNRXs#creating '%s' and adding '%s' to itcsx|D]z}tjjtjj||}tjj|r|td}sm|j||ntjd|qqWdS(Nis adding '%s'( RRRRRuRKRR R(tzR_tnamesRRR'(tbase_dirRX(s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytvisits !s2.4t compression(tzipfileRRRR_R RPR*RRt ZIP_STOREDt ZIP_DEFLATEDRtZipFileRR ( t zip_filenameRRiRXtcompressRjRRRRR_RR((RRXs@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR|s   (4t__doc__RRRt setuptoolsRtdistutils.dir_utilRRt sysconfigRRRt ImportErrortdistutils.sysconfigRt distutilsR tdistutils.errorsR t pkg_resourcesR R R RttypesRtsetuptools.compatRRtsetuptools.extensionRRR$RR%RRtsplitRRRRwRRRRRRRYR*R|(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytsD$     H    # -