Your IP : 3.16.66.154


Current Path : /lib64/python3.6/distutils/__pycache__/
Upload File :
Current File : //lib64/python3.6/distutils/__pycache__/cmd.cpython-36.opt-2.pyc

3


 \�J�@snddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZGdd�d�ZGdd�de�Z
dS)	�N)�DistutilsOptionError)�util�dir_util�	file_util�archive_util�dep_util)�logc@seZdZgZdd�Zdd�Zdd�Zdd�Zd	d
�ZdBd
d�Z	dd�Z
dCdd�Zdd�ZdDdd�Z
dEdd�Zdd�ZdFdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdGd&d'�ZdHd)d*�Zd+d,�Zd-d.�Zd/d0�ZdId1d2�ZdJd4d5�ZdKd6d7�ZdLd8d9�ZdMd:d;�ZdNd<d=�ZdOd>d?�Z dPd@dA�Z!dS)Q�CommandcCsbddlm}t||�std��|jtkr0td��||_|j�d|_	|j
|_
d|_d|_d|_
dS)Nr)�Distributionz$dist must be a Distribution instancezCommand is an abstract class)Zdistutils.distr
�
isinstance�	TypeError�	__class__r	�RuntimeError�distribution�initialize_optionsZ_dry_run�verbose�force�help�	finalized)�selfZdistr
�r�%/usr/lib64/python3.6/distutils/cmd.py�__init__/s


zCommand.__init__cCs<|dkr0t|d|�}|dkr*t|j|�S|Snt|��dS)N�dry_run�_)�getattrr�AttributeError)r�attrZmyvalrrr�__getattr___szCommand.__getattr__cCs|js|j�d|_dS)N�)r�finalize_options)rrrr�ensure_finalizediszCommand.ensure_finalizedcCstd|j��dS)Nz,abstract method -- subclass %s must override)rr
)rrrrr{s
zCommand.initialize_optionscCstd|j��dS)Nz,abstract method -- subclass %s must override)rr
)rrrrr �szCommand.finalize_optionsN�cCs�ddlm}|dkr d|j�}|j||tjd�|d}x\|jD]R\}}}|j|�}|d	dkrp|dd
�}t||�}|j|d||ftjd�qDWdS)Nr)�
longopt_xlatezcommand options for '%s':)�levelz  r�=z%s = %s���r&)	Zdistutils.fancy_getoptr#�get_command_name�announcer�INFO�user_options�	translater)r�header�indentr#�optionr�valuerrr�dump_options�s

zCommand.dump_optionscCstd|j��dS)Nz,abstract method -- subclass %s must override)rr
)rrrr�run�s
zCommand.runrcCstj||�dS)N)r)r�msgr$rrrr(�szCommand.announcecCs&ddlm}|r"t|�tjj�dS)Nr)�DEBUG)Zdistutils.debugr3�print�sys�stdout�flush)rr2r3rrr�debug_print�szCommand.debug_printcCsBt||�}|dkr"t|||�|St|t�s>td|||f��|S)Nz'%s' must be a %s (got `%s`))r�setattrr�strr)rr.�what�default�valrrr�_ensure_stringlike�s

zCommand._ensure_stringlikecCs|j|d|�dS)N�string)r>)rr.r<rrr�
ensure_string�szCommand.ensure_stringcCspt||�}|dkrdSt|t�r6t||tjd|��n6t|t�rTtdd�|D��}nd}|sltd||f��dS)Nz,\s*|\s+css|]}t|t�VqdS)N)rr:)�.0�vrrr�	<genexpr>�sz-Command.ensure_string_list.<locals>.<genexpr>Fz''%s' must be a list of strings (got %r))	rrr:r9�re�split�list�allr)rr.r=�okrrr�ensure_string_list�s


zCommand.ensure_string_listcCs8|j|||�}|dk	r4||�r4td|||f��dS)Nzerror in '%s' option: )r>r)rr.Ztesterr;Z	error_fmtr<r=rrr�_ensure_tested_string�szCommand._ensure_tested_stringcCs|j|tjjdd�dS)N�filenamez$'%s' does not exist or is not a file)rJ�os�path�isfile)rr.rrr�ensure_filename�szCommand.ensure_filenamecCs|j|tjjdd�dS)Nzdirectory namez)'%s' does not exist or is not a directory)rJrLrM�isdir)rr.rrr�ensure_dirnameszCommand.ensure_dirnamecCst|d�r|jS|jjSdS)N�command_name)�hasattrrRr
�__name__)rrrrr'	s
zCommand.get_command_namecGsJ|jj|�}|j�x0|D](\}}t||�dkrt||t||��qWdS)N)r�get_command_objr!rr9)rZsrc_cmdZoption_pairsZsrc_cmd_objZ
src_optionZ
dst_optionrrr�set_undefined_optionss
zCommand.set_undefined_optionscCs|jj||�}|j�|S)N)rrUr!)r�commandZcreateZcmd_objrrr�get_finalized_command$szCommand.get_finalized_commandrcCs|jj||�S)N)r�reinitialize_command)rrWZreinit_subcommandsrrrrY0szCommand.reinitialize_commandcCs|jj|�dS)N)r�run_command)rrWrrrrZ4szCommand.run_commandcCs6g}x,|jD]"\}}|dks$||�r|j|�qW|S)N)�sub_commands�append)rZcommandsZcmd_name�methodrrr�get_sub_commands;s
zCommand.get_sub_commandscCstjd|j�|�dS)Nzwarning: %s: %s
)r�warnr')rr2rrrr_KszCommand.warncCstj||||jd�dS)N)r)r�executer)r�func�argsr2r$rrrr`NszCommand.execute�cCstj|||jd�dS)N)r)r�mkpathr)r�name�moderrrrdQszCommand.mkpathc	Cstj|||||j||jd�S)N)r)r�	copy_filerr)r�infile�outfile�
preserve_mode�preserve_times�linkr$rrrrgTs

zCommand.copy_filec	Cstj||||||j|jd�S)N)r)r�	copy_treerr)rrhrirjrkZpreserve_symlinksr$rrrrm]s
zCommand.copy_treecCstj|||jd�S)N)r)r�	move_filer)r�src�dstr$rrrrnfszCommand.move_filecCs ddlm}||||jd�dS)Nr)�spawn)r)Zdistutils.spawnrqr)r�cmdZsearch_pathr$rqrrrrqjsz
Command.spawnc	Cstj|||||j||d�S)N)r�owner�group)r�make_archiver)rZ	base_name�formatZroot_dirZbase_dirrsrtrrrruoszCommand.make_archivecCs�|dkrd|}t|t�r"|f}nt|ttf�s8td��|dkrRd|dj|�f}|jsdtj||�rv|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:rF�tupler�joinrrZnewer_groupr`r�debug)rZinfilesrirarbZexec_msgZskip_msgr$rrr�	make_fileus

zCommand.make_file)Nr")r)N)N)N)r)r)Nr)rc)rrNr)rrrr)r)rr)NNNN)NNr)"rT�
__module__�__qualname__r[rrr!rr r0r1r(r8r>r@rIrJrOrQr'rVrXrYrZr^r_r`rdrgrmrnrqrurzrrrrr	sD0
















r	c@s2eZdZd
gZdd�Zdd�Zdd	�Zd
d�ZdS)�install_misc�install-dir=�d�!directory to install the files tocCsd|_g|_dS)N)�install_dir�outfiles)rrrrr�szinstall_misc.initialize_optionscCs|jd|df�dS)NZinstallr�)rV)r�dirnamerrr�_install_dir_from�szinstall_misc._install_dir_fromcCsRg|_|sdS|j|j�x2|D]*}|j||j�|jjtjj|j|��q WdS)N)r�rdr�rgr\rLrMrx)rZfilelist�frrr�_copy_files�s
zinstall_misc._copy_filescCs|jS)N)r�)rrrr�get_outputs�szinstall_misc.get_outputsN)r~rr�)rTr{r|r*rr�r�r�rrrrr}�s
	r})r5rLrDZdistutils.errorsrZ	distutilsrrrrrrr	r}rrrr�<module>s