Your IP : 3.138.105.128


Current Path : /opt/alt/python38/lib64/python3.8/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/distutils/__pycache__/cmd.cpython-38.opt-2.pyc

U

i�f�F�@s^ddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZGdd�d�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��||_|��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�2/opt/alt/python38/lib64/python3.8/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|��d|_dS)N�)r�finalize_options�rrrr�ensure_finalizediszCommand.ensure_finalizedcCstd|j��dS�Nz,abstract method -- subclass %s must override�rrr"rrrr{s
�zCommand.initialize_optionscCstd|j��dSr$r%r"rrrr!�s�zCommand.finalize_optionsN�cCs�ddlm}|dkr d|��}|j||tjd�|d}|jD]R\}}}|�|�}|ddkrn|dd�}t||�}|j|d||ftjd�qBdS)	Nr)�
longopt_xlatezcommand options for '%s':)�levelz  ����=z%s = %s)	Zdistutils.fancy_getoptr'�get_command_name�announcer	�INFOZuser_options�	translater)r�header�indentr'�optionr�valuerrr�dump_options�s

�zCommand.dump_optionscCstd|j��dSr$r%r"rrr�run�s
�zCommand.runr cCst�||�dS�Nr)r�msgr(rrrr,�szCommand.announcecCs&ddlm}|r"t|�tj��dS)Nr)�DEBUG)Zdistutils.debugr7�print�sys�stdout�flush)rr6r7rrr�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)rr1�what�default�valrrr�_ensure_stringlike�s

�zCommand._ensure_stringlikecCs|�|d|�dS)N�string)rB)rr1r@rrr�
ensure_string�szCommand.ensure_stringcCspt||�}|dkrdSt|t�r6t||t�d|��n6t|t�rTtdd�|D��}nd}|sltd||f��dS)Nz,\s*|\s+css|]}t|t�VqdSr5)rr>)�.0�vrrr�	<genexpr>�sz-Command.ensure_string_list.<locals>.<genexpr>Fz''%s' must be a list of strings (got %r))	rrr>r=�re�split�list�allr)rr1rA�okrrr�ensure_string_list�s


��zCommand.ensure_string_listcCs6|�|||�}|dk	r2||�s2td|||f��dS)Nzerror in '%s' option: )rBr)rr1Ztesterr?Z	error_fmtr@rArrr�_ensure_tested_string�s
�zCommand._ensure_tested_stringcCs|�|tjjdd�dS)N�filenamez$'%s' does not exist or is not a file)rN�os�path�isfile�rr1rrr�ensure_filename�s�zCommand.ensure_filenamecCs|�|tjjdd�dS)Nzdirectory namez)'%s' does not exist or is not a directory)rNrPrQ�isdirrSrrr�ensure_dirnames�zCommand.ensure_dirnamecCst|d�r|jS|jjSdS)N�command_name)�hasattrrWr�__name__r"rrrr+	s
zCommand.get_command_namecGsF|j�|�}|��|D](\}}t||�dkrt||t||��qdSr5)r�get_command_objr#rr=)rZsrc_cmdZoption_pairsZsrc_cmd_objZ
src_optionZ
dst_optionrrr�set_undefined_optionss
zCommand.set_undefined_optionscCs|j�||�}|��|Sr5)rrZr#)r�commandZcreateZcmd_objrrr�get_finalized_command$szCommand.get_finalized_commandrcCs|j�||�Sr5)r�reinitialize_command)rr\Zreinit_subcommandsrrrr^0s�zCommand.reinitialize_commandcCs|j�|�dSr5)r�run_command)rr\rrrr_4szCommand.run_commandcCs2g}|jD]"\}}|dks"||�r
|�|�q
|Sr5)�sub_commands�append)rZcommandsZcmd_name�methodrrr�get_sub_commands;s
zCommand.get_sub_commandscCst�d|��|�dS)Nzwarning: %s: %s
)r	�warnr+)rr6rrrrdKszCommand.warncCstj||||jd�dS�N�r)r�executer)r�func�argsr6r(rrrrgNszCommand.execute�cCstj|||jd�dSre)r�mkpathr)r�name�moderrrrkQszCommand.mkpathc	Cstj|||||j||jd�Sre)r�	copy_filerr)r�infile�outfile�
preserve_mode�preserve_times�linkr(rrrrnTs
�zCommand.copy_filec	Cstj||||||j|jd�Sre)r�	copy_treerr)rrorprqrrZpreserve_symlinksr(rrrrt]s
�zCommand.copy_treecCstj|||jd�Sre)r�	move_filer)r�srcZdstr(rrrrufszCommand.move_filecCs ddlm}||||jd�dS)Nr)�spawnrf)Zdistutils.spawnrwr)r�cmdZsearch_pathr(rwrrrrwjsz
Command.spawnc	Cstj|||||j||d�S)N)r�owner�group)r�make_archiver)rZ	base_name�formatZroot_dirZbase_dirryrzrrrr{os
�zCommand.make_archivecCs�|dkrd|}t|t�r"|f}nt|ttf�s8td��|dkrRd|d�|�f}|jsdt�||�rv|�	||||�n
t
�|�dS)Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating %s from %sz, )rr>rJ�tupler
�joinrrZnewer_grouprgr	�debug)rZinfilesrprhriZexec_msgZskip_msgr(rrr�	make_fileus

�zCommand.make_file)Nr&)r )N)N)N)r )r)Nr )rj)r r Nr )r r rr )r )r r )NNNN)NNr )"rY�
__module__�__qualname__r`rrr#rr!r3r4r,r<rBrDrMrNrTrVr+r[r]r^r_rcrdrgrkrnrtrurwr{r�rrrrr
sX0






�




�
	�
	

�
�r
)
r9rPrHZdistutils.errorsrZ	distutilsrrrrrr	r
rrrr�<module>s

?>