MINI MINI MANI MO

Path : /usr/lib64/python3.6/distutils/command/__pycache__/
File Upload :
Current File : //usr/lib64/python3.6/distutils/command/__pycache__/bdist_wininst.cpython-36.pyc

3


 \J<@spdZddlZddlZddlmZddlmZddlmZm	Z	ddl
TddlmZddl
mZGd	d
d
eZdS)zzdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.N)Command)get_platform)create_treeremove_tree)*)get_python_version)logc@seZdZdZd4dddefd6d8d9d:d;d<d=d>d?d@dAg
ZddddgZd&d'Zd(d)Zd*d+Z	d,d-Z
dBd.d/Zd0d1Zd2d3Z
dS)C
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)	keep-tempkz/keep the pseudo-installation tree around after z!creating the distribution archivetarget-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=Ubasename of installation script to be run after installation 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 UACcCsRd|_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)selfr57/usr/lib64/python3.6/distutils/command/bdist_wininst.pyinitialize_options:sz bdist_wininst.initialize_optionscCs|jdd	|jdkrR|jr6|jr6|jjd}|j|_|jdj}tj	j
|d|_|js^d|_|jr|jjrt
}|jr|j|krtd|f||_|jdd
d|jrx2|jjD]}|jtj	j|krPqWtd|jdS)Nbdistr0ZwininstzMtarget version can only be %s, or the '--skip-build' option must be specifiedr-r(z(install_script '%s' not found in scripts)r0r0)r-r-)r(r()Zset_undefined_optionsr'r0r(distributionZget_command_objget_finalized_command
bdist_baseospathjoinr,has_ext_modulesrZDistutilsOptionErrorr1scriptsbasename)r4r8r<Z
short_versionscriptr5r5r6finalize_optionsJs4

zbdist_wininst.finalize_optionsc
Cstjdkr&|jjs|jjr&td|js6|jd|jddd}|j	|_
|j|_d|_|j|_|jd}d|_
d|_|jjr|j}|s|jstd	d
tjdd}d|j|f}|jd}tjj|jd
||_x6dD].}|j}|dkr|d}t|d||qWtjd|j	|jtjjdtjj|j	d|jtjd=ddlm }|}	|jj!}
|j"|	d|j	d}|j#||
|j$|jjrt%}nd}|jj&j'd||j(|
ftj)d|tj*||j+st,|j	|j-ddS)Nwin32z^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformbuildinstall)Zreinit_subcommandsrinstall_libz Should have already checked thisz%d.%dz.%s-%slibpurelibplatlibheadersrAdataz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)mktempzip)Zroot_diranyr	zremoving temporary file '%s')dry_run)rLrMrNrArO).sysplatformr:r@Zhas_c_librariesZDistutilsPlatformErrorr0Zrun_commandZreinitialize_commandr'rootZwarn_dirr(compileoptimizer,AssertionErrorversion_infor;r=r>r?Z
build_baseZ	build_libuppersetattrrinfoZensure_finalizedinsertrunZtempfilerPget_fullnameZmake_archive
create_exer.rZ
dist_filesappendget_installer_filenamedebugremover)rrS)
r4rGrIr,Zplat_specifierrFkeyvaluerPZarchive_basenamefullnamearcnameZ	pyversionr5r5r6r_psf













zbdist_wininst.runcCs`g}|jj}|jd|jpdd}dd}xJdD]B}t||d}|r2|d|j||f}|jd|||fq2W|jd|jr|jd|j|jd|||jd|j|jd|j|j	r|jd|j	|j
r|jd|j
|jp|jj}|jd||ddl
}ddl}	d|j|j
|	jf}
|jd|
dj|S)Nz
[metadata]r9
cSs|jddS)Nrjz\n)replace)sr5r5r6escapesz)bdist_wininst.get_inidata.<locals>.escapeauthorauthor_emaildescription
maintainermaintainer_emailnameurlversionz
    %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)rnrorprqrrrsrtru)r:metadatarbZlong_descriptiongetattr
capitalizer1r*r+r,r3r/r`time	distutilsZctime__version__r?)r4linesrvr]rmrsrOr/ryrzZ
build_infor5r5r6get_inidatas<

zbdist_wininst.get_inidatac
Csddl}|j|j|j}|j|}|jd||rPt|dj}t|}nd}t|d}	|	j	|j
|rz|	j	|t|tr|j
d}|d}|jrt|jddd	}
|
jj
d}WdQRX||d
}n|d}|	j	||jddt||}|	j	||	j	t|djdS)
Nrzcreating %srbwbmbcsrzlatin-1)encodings
z<iiii{V4)structZmkpathr-r}rcZannounceopenreadlenwrite
get_exe_bytes
isinstancestrencoder2Zpack)
r4rirhr.rZcfgdatainstaller_nameZ
bitmapdataZ	bitmaplenfilerCZscript_dataheaderr5r5r6ras:








zbdist_wininst.create_execCsD|jr&tjj|jd||j|jf}ntjj|jd||jf}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r,r=r>r?r-r()r4rhrr5r5r6rc$s

z$bdist_wininst.get_installer_filenamec	Cs t}|jrl|j|krl|jdkr&d}q|jdkr6d}q|jdkrFd}q|jdkrVd}q|jdkrfd	}qd
}n@yddlm}Wntk
rd
}YnX|jd
d}|d}tjjt	}|j
dkr|j
dddkr|j
dd}nd}tjj|d||f}t|d}z|j
S|jXdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)CRT_ASSEMBLY_VERSION.z.0rEwinr9zwininst-%s%s.exer~)rr,ZmsvcrtrImportError	partitionr=r>dirname__file__r(r?rrclose)	r4Zcur_versionZbvrmajorZ	directoryZsfixfilenamefr5r5r6r1s8	






zbdist_wininst.get_exe_bytes)r
NrPkeep the pseudo-installation tree around after creating the distribution archive)r
rr6require a specific python version on the target system)rNr)rrr)rrr)rrr)rrr)rrr)rNr )r!Nr")r#Nr$)r%Nr&)N)__name__
__module____qualname__rprZuser_optionsZboolean_optionsr7rDr_r}rarcrr5r5r5r6r	sN&Q.
5
r	)__doc__rTr=Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrzrr	r5r5r5r6<module>s

OHA YOOOO