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



]J@sddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZGdddZGdddeZ
dS)	N)DistutilsOptionError)utildir_util	file_utilarchive_utildep_util)logc@seZdZgZddZddZddZddZd	d
Zddd
dZ	ddZ
dddZddZdddZ
dddZddZdddZddZd d!Zd"d#Zd$d%Zdd&d'Zd(d)d*Zd+d,Zd-d.Zd/d0Zddd1d2Zd3d4d5Zddddd6d7Zddd(dd8d9Zdd:d;Zddd<d=Zddddd>d?Z dddd@dAZ!dS)BCommandcCsddlm}t||s+td|jtkrFtd||_|jd|_	|j
|_
d|_d|_d|_
dS)Nr)Distributionz$dist must be a Distribution instancezCommand is an abstract class)Zdistutils.distr

isinstance	TypeError	__class__r	RuntimeErrordistributioninitialize_optionsZ_dry_runverboseforcehelp	finalized)selfZdistr
r(/opt/alt/python35/lib64/python3.5/cmd.py__init__/s	

			zCommand.__init__cCsR|dkrBt|d|}|dkr;t|j|S|Snt|dS)Ndry_run_)getattrrAttributeError)rattrZmyvalrrr__getattr___szCommand.__getattr__cCs |js|jd|_dS)N)rfinalize_options)rrrrensure_finalizedis	
zCommand.ensure_finalizedcCstd|jdS)Nz,abstract method -- subclass %s must override)rr
)rrrrr{s
zCommand.initialize_optionscCstd|jdS)Nz,abstract method -- subclass %s must override)rr
)rrrrr szCommand.finalize_optionsNcCsddlm}|dkr,d|j}|j||dtj|d}x||jD]q\}}}|j|}|d	dkr|dd
}t||}|j|d||fdtjqZWdS)Nr)
longopt_xlatezcommand options for '%s':levelz  r=z%s = %sr&)	Zdistutils.fancy_getoptr#get_command_nameannouncerINFOuser_options	translater)rheaderindentr#optionrvaluerrrdump_optionss
zCommand.dump_optionscCstd|jdS)Nz,abstract method -- subclass %s must override)rr
)rrrrruns
zCommand.runrcCstj||dS)N)r)rmsgr$rrrr(szCommand.announcecCs1ddlm}|r-t|tjjdS)Nr)DEBUG)Zdistutils.debugr3printsysstdoutflush)rr2r3rrrdebug_prints
zCommand.debug_printcCs[t||}|dkr/t||||St|tsWtd|||f|S)Nz'%s' must be a %s (got `%s`))rsetattrrstrr)rr.whatdefaultvalrrr_ensure_stringlikeszCommand._ensure_stringlikecCs|j|d|dS)Nstring)r>)rr.r<rrr
ensure_stringszCommand.ensure_stringcCst||}|dkrdSt|trMt||tjd|nMt|trxtdd|D}nd}|std||fdS)Nz,\s*|\s+css|]}t|tVqdS)N)rr:).0vrrr	<genexpr>sz-Command.ensure_string_list.<locals>.<genexpr>Fz''%s' must be a list of strings (got %r))	rrr:r9resplitlistallr)rr.r=okrrrensure_string_listszCommand.ensure_string_listcCsL|j|||}|dk	rH||rHtd|||fdS)Nzerror in '%s' option: )r>r)rr.Ztesterr;Z	error_fmtr<r=rrr_ensure_tested_strings
zCommand._ensure_tested_stringcCs |j|tjjdddS)Nfilenamez$'%s' does not exist or is not a file)rJospathisfile)rr.rrrensure_filenameszCommand.ensure_filenamecCs |j|tjjdddS)Nzdirectory namez)'%s' does not exist or is not a directory)rJrLrMisdir)rr.rrrensure_dirnameszCommand.ensure_dirnamecCs$t|dr|jS|jjSdS)Ncommand_name)hasattrrRr
__name__)rrrrr'	szCommand.get_command_namecGse|jj|}|jxB|D]:\}}t||dkr#t||t||q#WdS)N)rget_command_objr!rr9)rZsrc_cmdZoption_pairsZsrc_cmd_objZ
src_optionZ
dst_optionrrrset_undefined_optionss

zCommand.set_undefined_optionscCs#|jj||}|j|S)N)rrUr!)rcommandZcreateZcmd_objrrrget_finalized_command$s
zCommand.get_finalized_commandrcCs|jj||S)N)rreinitialize_command)rrWZreinit_subcommandsrrrrY0szCommand.reinitialize_commandcCs|jj|dS)N)rrun_command)rrWrrrrZ4szCommand.run_commandcCsIg}x<|jD]1\}}|dks4||r|j|qW|S)N)sub_commandsappend)rcommandsZcmd_namemethodrrrget_sub_commands;s
zCommand.get_sub_commandscCs!tjd|j|fdS)Nzwarning: %s: %s
)rwarnr')rr2rrrr`Ks	zCommand.warncCs tj|||d|jdS)Nr)rexecuter)rfuncargsr2r$rrrraOszCommand.executeicCstj||d|jdS)Nr)rmkpathr)rnamemoderrrrdRszCommand.mkpathc	Cs)tj|||||j|d|jS)Nr)r	copy_filerr)rinfileoutfile
preserve_modepreserve_timeslinkr$rrrrgUszCommand.copy_filec	Cs)tj||||||jd|jS)Nr)r	copy_treerr)rrhrirjrkZpreserve_symlinksr$rrrrm^szCommand.copy_treecCstj||d|jS)Nr)r	move_filer)rsrcdstr$rrrrngszCommand.move_filecCs*ddlm}|||d|jdS)Nr)spawnr)Zdistutils.spawnrqr)rcmdZsearch_pathr$rqrrrrqksz
Command.spawncCs+tj||||d|jd|d|S)Nrownergroup)rmake_archiver)r	base_nameformatroot_dirbase_dirrsrtrrrrups	zCommand.make_archivecCs|dkrd|}t|tr1|f}n!t|ttfsRtd|dkrwd|dj|f}|jstj||r|j	||||n
t
j|dS)Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating %s from %sz, )rr:rFtuplerjoinrrZnewer_grouprardebug)rZinfilesrirbrcZexec_msgZskip_msgr$rrr	make_filevs

	zCommand.make_file)"rT
__module____qualname__r[rrr!rr r0r1r(r8r>r@rIrJrOrQr'rVrXrYrZr_r`rardrgrmrnrqrur}rrrrr	sD0



r	c@sIeZdZd
gZddZddZdd	Zd
dZdS)install_miscinstall-dir=d!directory to install the files tocCsd|_g|_dS)N)install_diroutfiles)rrrrrs	zinstall_misc.initialize_optionscCs|jd|dfdS)Ninstallr)rV)rdirnamerrr_install_dir_fromszinstall_misc._install_dir_fromcCsmg|_|sdS|j|jxC|D];}|j||j|jjtjj|j|q*WdS)N)rrdrrgr\rLrMr{)rZfilelistfrrr_copy_filess	
zinstall_misc._copy_filescCs|jS)N)r)rrrrget_outputsszinstall_misc.get_outputsN)rrr)rTr~rr*rrrrrrrrrs
		r)r5rLrDZdistutils.errorsrZ	distutilsrrrrrrr	rrrrr<module>s$(
Back to Directory File Manager