Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/distutils/command/
Upload File :
Current File : //usr/lib/python2.7/distutils/command/bdist_wininst.pyc


|_c@sdZdZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZdd	lmZd
efdYZdS(szdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.s$Id$iN(tget_python_version(tCommand(tremove_tree(tDistutilsOptionErrortDistutilsPlatformError(tlog(tget_platformt
bdist_wininstcBseZdZd,dddefdddd	fd
d+ddfd-d.d/d0d1d2d3d4d5g
Zdd
ddgZd$Zd%Zd&Z	d'Z
d+d(Zd)Zd*Z
RS(6s-create an executable installer for MS Windowss
bdist-dir=s1temporary directory for creating the distributions
plat-name=tps;platform name to embed in generated filenames (default: %s)s	keep-temptks/keep the pseudo-installation tree around after s!creating the distribution archivestarget-version=s!require a specific python versions on the target systemsno-target-compiletcs/do not compile .py to .pyc on the target systemsno-target-optimizetos:do not compile .py to .pyo (optimized)on the target systems	dist-dir=tds-directory to put final built distributions insbitmap=tbs>bitmap to use for the installer instead of python-powered logostitle=tts?title to display on the installer background instead of defaults
skip-builds2skip rebuilding everything (for testing/debugging)sinstall-script=sTbasename of installation script to be run afterinstallation or before deinstallationspre-install-script=s{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionsuser-access-control=sspecify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACcCsyd|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
dS(Ni(tNonet	bdist_dirt	plat_namet	keep_temptno_target_compiletno_target_optimizettarget_versiontdist_dirtbitmapttitlet
skip_buildtinstall_scripttpre_install_scripttuser_access_control(tself((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pytinitialize_options@s												cCsV|jdd	|jdkr|jrR|jrR|jjd}|j|_n|jdj}t	j
j|d|_n|jsd|_n|jr|jj
rt}|jr|j|krtd|fn||_n|jdd
d|jrRxF|jjD]%}|jt	j
j|krPqqWtd|jndS(NtbdistRtwininsttsMtarget version can only be %s, or the '--skip-build' option must be specifiedRRs(install_script '%s' not found in scripts(s
skip_builds
skip_build(sdist_dirsdist_dir(s	plat_names	plat_name(tset_undefined_optionsRRRRtdistributiontget_command_objtget_finalized_commandt
bdist_basetostpathtjoinRthas_ext_modulesRRRtscriptstbasename(RRR&t
short_versiontscript((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pytfinalize_optionsRs4		
		c
Cstjdkr<|jjs-|jjr<tdn|jsU|jdn|jddd}|j	|_
|j|_d|_|j|_|jd}d|_
d|_|jjrB|j}|s|jstd	tjdd
!}nd|j|f}|jd}tjj|jd||_nxJdD]B}tj|}|dkrw|d}nt|d||qIWtjd|j	|jtjjdtjj|j	d|jtjd=ddl m!}|}	|jj"}
|j#|	dd|j	}|j$||
|j%|jjrYt&}nd}|jj'j(d||j)|
ftj*d|tj+||j,st-|j	d|j.ndS(Ntwin32s^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformtbuildtinstalltreinit_subcommandsiitinstall_libs Should have already checked thisis.%s-%stlibtpurelibtplatlibtheadersR+tdatas/Include/$dist_nametinstall_sinstalling to %stPURELIBi(tmktemptziptroot_dirtanyRsremoving temporary file '%s'tdry_run(spurelibsplatlibR8sscriptssdata(/tsystplatformR#R*thas_c_librariesRRtrun_commandtreinitialize_commandRtroottwarn_dirRtcompiletoptimizeRtAssertionErrortversionR%R'R(R)t
build_baset	build_libtstringtuppertsetattrRtinfotensure_finalizedtinserttrunttempfileR<tget_fullnametmake_archivet
create_exeRRt
dist_filestappendtget_installer_filenametdebugtremoveRRR@(
RR2R4Rtplat_specifierR1tkeytvalueR<tarchive_basenametfullnametarcnamet	pyversion((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pyRTzsf					


%

	
	c	Csg}|jj}|jd|jp+dd}d}xddddd	d
ddgD]a}t||d}|rZ|d
tj|||f}|jd|||fqZqZW|jd|jr|jd|jn|jd|||jd|j|jd|j	|j
rM|jd|j
n|jrm|jd|jn|jp|jj
}|jd||ddl}ddl}	d|j|j|	jf}
|jd|
tj|dS(Ns
[metadata]R!s
cSstj|ddS(Ns
s\n(RNtreplace(ts((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pytescapestauthortauthor_emailtdescriptiont
maintainertmaintainer_emailtnameturlRKs
    %s: %ss%s=%ss
[Setup]sinstall_script=%ssinfo=%sstarget_compile=%dstarget_optimize=%dstarget_version=%ssuser_access_control=%sstitle=%sisBuilt %s with distutils-%ss
build_info=%s(R#tmetadataRZtlong_descriptiontgetattrRNt
capitalizeRRRRRRRVttimet	distutilstctimet__version__R)(RtlinesRoRQRgRmR9RRsRtt
build_info((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pytget_inidatas<
	$
			cCsddl}|j|j|j}|j|}|jd||rrt|dj}t|}nd}t|d}	|	j	|j
|r|	j	|nytWntk
rn"Xt
|tr|jd}n|d}|jr)t|jdj}
||
d	}n
|d}|	j	||jd
dt||}|	j	||	j	t|djdS(Niscreating %strbitwbtmbcsttrs
s<iiii{V4(tstructtmkpathRRyR[tannouncetopentreadtlentwritet
get_exe_bytestunicodet	NameErrort
isinstancetencodeRtpack(RRcRbRRtcfgdatatinstaller_namet
bitmapdatat	bitmaplentfiletscript_datatheader((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pyRXs>

	

			
cCs`|jr7tjj|jd||j|jf}n%tjj|jd||jf}|S(Ns%s.%s-py%s.exes	%s.%s.exe(RR'R(R)RR(RRbR((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pyR[5s	c	CsFddlm}t}|jrm|j|krm|j|krL|}qv|jdkrdd}qvd}n	|}tjjt}|jdkr|jd dkr|jd}nd	}tjj	|d
||f}yt
|d}Wn1tk
r%}tt
|dtjd nXz|jSWd|jXdS(
Ni(tget_build_versions2.4g@gffffff@R0itwinR!swininst-%.1f%s.exeRzs), please install the python%s-dev package(tdistutils.msvccompilerRRRR'R(tdirnamet__file__RR)RtIOErrortDistutilsFileErrortstrRARKRtclose(	RRtcur_versiontbvt	directorytsfixtfilenametftmsg((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pyRCs*					""N(s
bdist-dir=Ns1temporary directory for creating the distribution(sno-target-compileR
s/do not compile .py to .pyc on the target system(sno-target-optimizeRs:do not compile .py to .pyo (optimized)on the target system(s	dist-dir=Rs-directory to put final built distributions in(sbitmap=R
s>bitmap to use for the installer instead of python-powered logo(stitle=Rs?title to display on the installer background instead of default(s
skip-buildNs2skip rebuilding everything (for testing/debugging)(sinstall-script=NsTbasename of installation script to be run afterinstallation or before deinstallation(spre-install-script=Ns{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution(suser-access-control=Nsspecify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UAC(t__name__t
__module__RjRRtuser_optionstboolean_optionsRR/RTRyRXR[R(((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pyRsN
					(	S	17	(t__doc__t__revision__RAR'RNt	sysconfigRtdistutils.coreRtdistutils.dir_utilRtdistutils.errorsRRRtRtdistutils.utilRR(((s5/usr/lib/python2.7/distutils/command/bdist_wininst.pyt<module>s