Viewing File: /opt/alt/python35/lib64/python3.5/distutils/command/__pycache__/bdist_wininst.cpython-35.opt-2.pyc



];@sddlZddlZddlmZddlmZddlmZmZddl	Tddl
mZddlm
Z
Gdd	d	eZdS)
N)Command)get_platform)create_treeremove_tree)*)get_python_version)logc@seZdZdZd4dddefdd	d
dfddd
dfd5d6d7d8d9d:d;d<d=g
ZddddgZd&d'Zd(d)Zd*d+Z	d,d-Z
dd.d/Zd0d1Zd2d3Z
dS)>
bdist_wininstz-create an executable installer for MS Windows
bdist-dir=N1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s)z	keep-tempkz/keep the pseudo-installation tree around after z!creating the distribution archiveztarget-version=z!require a specific python versionz on the target systemno-target-compilec/do not compile .py to .pyc on the target systemno-target-optimizeo:do not compile .py to .pyo (optimized)on the target system	dist-dir=d-directory to put final built distributions inbitmap=b>bitmap to use for the installer instead of python-powered logotitle=t?title to display on the installer background instead of default
skip-build2skip rebuilding everything (for testing/debugging)install-script=Tbasename of installation script to be run afterinstallation or before deinstallationpre-install-script={Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionuser-access-control=specify 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)Nr)
	bdist_dir	plat_name	keep_tempno_target_compileno_target_optimizetarget_versiondist_dirbitmaptitle
skip_buildinstall_scriptpre_install_scriptuser_access_control)selfr32/opt/alt/python35/lib64/python3.5/bdist_wininst.pyinitialize_options:s												z bdist_wininst.initialize_optionscCsG|jdd	|jdkry|jrO|jrO|jjd}|j|_|jdj}tj	j
|d|_|jsd|_|jr|jjrt
}|jr|j|krtd|f||_|jdd
d|jrCxC|jjD]"}|jtj	j|kr
Pq
Wtd|jdS)Nbdistr.ZwininstzMtarget version can only be %s, or the '--skip-build' option must be specifiedr+r&z(install_script '%s' not found in scripts)r.r.)r+r+)r&r&)Zset_undefined_optionsr%r.r&distributionZget_command_objget_finalized_command
bdist_baseospathjoinr*has_ext_modulesrZDistutilsOptionErrorr/scriptsbasename)r2r6r:Z
short_versionscriptr3r3r4finalize_optionsJs4			
			zbdist_wininst.finalize_optionsc
Cstjdkr9|jjs-|jjr9td|jsO|jd|jddd}|j	|_
|j|_d|_|j|_|jd}d|_
d|_|jjr$|j}|stjdd	}d
|j|f}|jd}tjj|jd||_xDdD]<}|j}|dkrS|d}t|d||q+Wtjd|j	|jtjjdtjj|j	d|jtjd=ddlm}|}	|jj }
|j!|	dd|j	}|j"||
|j#|jjr5t$}nd}|jj%j&d||j'|
ftj(d|tj)||j*st+|j	d|j,dS)Nwin32z^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformbuildinstallZreinit_subcommandsrinstall_libz.%s-%slibpurelibplatlibheadersr?dataz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)mktempziproot_diranyr	zremoving temporary file '%s'dry_run)rJrKrLr?rM)-sysplatformr8r>Zhas_c_librariesZDistutilsPlatformErrorr.Zrun_commandZreinitialize_commandr%rootZwarn_dirr&compileoptimizer*versionr9r;r<r=Z
build_baseZ	build_libuppersetattrrinfoZensure_finalizedinsertruntempfilerNget_fullnamemake_archive
create_exer,rZ
dist_filesappendget_installer_filenamedebugremover'rrR)
r2rErGr*Zplat_specifierrDkeyvaluerNZarchive_basenamefullnamearcnameZ	pyversionr3r3r4r]psd		
				


%

	
	zbdist_wininst.runcCsg}|jj}|jd|jp+dd}dd}x{dddd	d
ddd
gD][}t||d}|r]|d|j||f}|jd|||fq]W|jd|jr|jd|j|jd|||jd|j|jd|j|j	rD|jd|j	|j
ra|jd|j
|jpv|jj}|jd||ddl
}ddl}	d|j|j
|	jf}
|jd|
dj|S)Nz
[metadata]r7
cSs|jddS)Nrjz\n)replace)sr3r3r4escapesz)bdist_wininst.get_inidata.<locals>.escapeZauthorZauthor_emaildescriptionZ
maintainerZmaintainer_emailnameZurlrXz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r8metadatarbZlong_descriptiongetattr
capitalizer/r(r)r*r1r-r_time	distutilsctime__version__r=)r2linesrpr[rmrorMr-rsrtZ
build_infor3r3r4get_inidatas<
!
			zbdist_wininst.get_inidatac
Csddl}|j|j|j}|j|}|jd||rrt|dj}t|}nd}t|d}	|	j	|j
|r|	j	|t|tr|j
d}|d}|jr&t|jddd	}
|
jj
d	}WdQRX||d
}n
|d}|	j	||jddt||}|	j	||	j	t|djdS)
Nrzcreating %srbwbmbcssrencodingzlatin-1s
z<iiii{V4)structZmkpathr+rxrcZannounceopenreadlenwrite
get_exe_bytes
isinstancestrencoder0pack)
r2rirhr,r~Zcfgdatainstaller_nameZ
bitmapdataZ	bitmaplenfilerAZscript_dataheaderr3r3r4ras:

	

			
zbdist_wininst.create_execCs`|jr7tjj|jd||j|jf}n%tjj|jd||jf}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r*r;r<r=r+r&)r2rhrr3r3r4rc$s	z$bdist_wininst.get_installer_filenamecCst}|jr|j|kr|jdkr9d}q|jdkrQd}q|jdkrid}q|jdkrd}q|jdkrd	}qd
}nZyddlm}Wntk
rd
}Yn,Xtd
j|jd
ddd}tj	j
t}|jdkrL|jdddkrL|jdd}nd}tj	j|d||f}t
|d}z|jSWd|jXdS)Nz2.4g@gffffff@z2.5g @z3.2g"@z3.4g$@g,@r)CRT_ASSEMBLY_VERSION.rCrHwinr7zwininst-%.1f%s.exery)rr*msvcrtrImportErrorfloatr=splitr;r<dirname__file__r&rrclose)r2Zcur_versionZbvrZ	directoryZsfixfilenamefr3r3r4r1s6								
+(zbdist_wininst.get_exe_bytes)r
Nr)rrr)rrr)rrr)rrr)rrr)rNr)rNr )r!Nr")r#Nr$)__name__
__module____qualname__rnrZuser_optionsZboolean_optionsr5rBr]rxrarcrr3r3r3r4r	sN
			&Q.5
r	)rSr;Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrtrr	r3r3r3r4<module>s

Back to Directory File Manager