Viewing File: /usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyo


b-Qc@sdZddlZddlZddlZddlmZddlmZmZy#ddl	m
Z
mZdZWn0e
k
rddlmZmZdZnXdd	lmZdd
lmZddlmZmZmZdd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(tremove_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
ddfd!d"gZd	ddgZdZdZdZ	dZ
dZdZ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|jdd|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,Rtset_undefined_optionsR0Rtegg_nametegg_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
|trt|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+R7tinstall_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.pytget_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_commandtrun_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
||<qW|j|j|r|j|n|jjr|jn|j}tjj|d}
|j|
|jjr(tjj|
d}tjd
||j
dd|ddn|j |
tjj|
d}|rtjd||jst!|t"|d}|j#dj||j#d|j$qn?tjj%|rtjd||jstj&|qnt'tjj|d|j(tjj)tjj|j*drKtj+dn|j,ra|j-nt.|j/|d|j0d|jd|j1|j2st3|jd|jnt4|jdgjdt5|j/fdS(NR4sinstalling library code to %sRAt
build_clibREtwarn_diris.pyscreating stub loader for %st/sEGG-INFOtscriptssinstalling scripts to %stinstall_scriptstinstall_dirtno_episnative_libs.txts
writing %stwts
sremoving %ssdepends.txtsxWARNING: 'depends.txt' will not be used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.tverboseRXtmodet
dist_filesR%(6R\R	RPR+R7RDR*R=thas_c_librariesR/RQtget_ext_outputststubst	enumerateRRRRRRORXR$R?treplaceRNtextendtmake_init_filestbyte_compileRHRVRRdtcopy_metadata_toR
RRR tisfiletunlinktwrite_safety_flagtzip_safetexistsR4twarnR1tzap_pyfilestmake_zipfileR0Rit
gen_headerR-RtgetattrR(R2tinstcmdtold_rootR`tall_outputstext_outputst
to_compileR'text_nameRtextR"tarchive_rootR4t
script_dirtnative_libst	libs_file((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytrunsx
				"	

	

	

	$
	
	cCstjdxut|jD]d\}}}xR|D]J}|jdr3tjj||}tjd|tj	|q3q3WqWdS(Ns+Removing .py files from temporary directorys.pysDeleting %s(
R	RPtwalk_eggR+RRRRtdebugRv(R2tbasetdirstfilestnameR((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR{s

cCsEt|jdd}|dk	r%|Stjdt|j|jS(NRxs4zip_safe flag not set; analyzing archive contents...(R~R=R*R	Rztanalyze_eggR+Rn(R2tsafe((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRx
s

c	Csg}xt|jD]\}}}||jkr:qnx|D]}|jdrAd|kr|t|jdjtjd}|jj|rt	j
d|tjj|d}|j
st|d}|jt|jn|j|qnPqAqAWg|(qW|S(s%Create missing package __init__ filess.pys__init__.pyiRs#Creating missing __init__.py for %sR(RR+RRKRpRRNR=thas_contents_forR	RzRRRXRRtNS_PKG_STUBR RO(	R2t
init_filesRRRRtpkgRR#((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRrs&
&	

c
Cs!tj|jjpd}|jdijd}|dkrFdS|jsY|jrotd|fnt	j
d }|j}dj|j}|jd}t
jj|j}d	t}|jstt
jj|jd
|jt|jd}	|	j||	jndS(NRssetuptools.installationteggsecutableRsGeggsecutable entry point (%r) cannot have 'extras' or refer to a moduleiRisH#!/bin/sh
if [ `basename $0` = "%(basename)s" ]
then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@"
else
  echo $0 is not the correct name for this egg file.
  echo Please rename it back to %(basename)s and try again.
  exec false
fi
RXta(Rt	parse_mapR=tentry_pointstgetR*tattrstextrasR
tsystversiontmodule_nameRRRR?R0tlocalsRXRR_RRR (
R2tepmteptpyverRtfullRR?theaderR#((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR}*s*
	

	"

cCstjj|j}tjj|d}xb|jjjD]Q}|j|r:tjj||t	|}t
||j||q:q:WdS(s*Copy metadata (egg info) to the target_dirRN(RRtnormpathR4RR8tfilelistRRMRKR
t	copy_file(R2t
target_dirt
norm_egg_infotprefixRttarget((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRtSs
cCsg}g}id|j6}xtj|jD]\}}}xH|D]@}tjj|djtkrE|j|||qEqEWx3|D]+}|||d|tjj||<qWq/W|j	j
r|jd}x|jD]}	t
|	trqn|j|	j}
|j|
}tjj|jdstjjtjj|j|ry|j|qyqqWn||fS(sAGet a list of relative paths to C extensions in the output distroRiRct	build_extsdl-(R+RtwalkRRtlowertNATIVE_EXTENSIONSRORR=R>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__tdescriptionRR*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_scanRtTrueRRtscan_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|jq
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
dgD].}||krtjd||t}
qqWd
|krxZdddddddddddgD].}||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
findsourcetgetcommentst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
|jgt|}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(Nisadding '%s'(	RRRRRuRKRR	R(tzR_tnamesRRR'(tbase_dirRX(s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytvisits
!s2.4tcompression(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	sysconfigRRRtImportErrortdistutils.sysconfigRt	distutilsR	tdistutils.errorsR
t
pkg_resourcesRRR
RttypesRtsetuptools.compatRRtsetuptools.extensionRRR$RR%RRtsplitRRRRwRRRRRRRYR*R|(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt<module>sD$


		H	
		

	#	
	-	
Back to Directory File Manager