AlkantarClanX12

Your IP : 3.141.38.5


Current Path : /proc/self/root/opt/alt/python39/lib64/python3.9/distutils/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python39/lib64/python3.9/distutils/__pycache__/cmd.cpython-39.opt-2.pyc

a

R�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��|jtur0td��||_|��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/python39/lib64/python3.9/distutils/cmd.py�__init__/s


zCommand.__init__cCs<|dkr0t|d|�}|dur*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}|dur 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||�}|dur"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||�}|durdSt|t�r6t||t�d|��n6t|t�rTtdd�|D��}nd}|sltd||f��dS)Nz,\s*|\s+css|]}t|t�VqdSr5)rr>)�.0�vrrr�	<genexpr>��z-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|�|||�}|dur2||�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)rO�os�path�isfile�rr1rrr�ensure_filename�s�zCommand.ensure_filenamecCs|�|tjjdd�dS)Nzdirectory namez)'%s' does not exist or is not a directory)rOrQrR�isdirrTrrr�ensure_dirnames�zCommand.ensure_dirnamecCst|d�r|jS|jjSdS)N�command_name)�hasattrrXr�__name__r"rrrr+	s
zCommand.get_command_namecGsF|j�|�}|��|D](\}}t||�durt||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)rr[r#)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]"\}}|dus"||�r
|�|�q
|Sr5)�sub_commands�append)rZcommandsZcmd_name�methodrrr�get_sub_commands;s
zCommand.get_sub_commandscCst�d|��|�dS)Nzwarning: %s: %s
)r	�warnr+)rr6rrrreKszCommand.warncCstj||||jd�dS�N�r)r�executer)r�func�argsr6r(rrrrhNszCommand.execute�cCstj|||jd�dSrf)r�mkpathr)r�name�moderrrrlQszCommand.mkpathc	Cstj|||||j||jd�Srf)r�	copy_filerr)r�infile�outfile�
preserve_mode�preserve_times�linkr(rrrroTs

�zCommand.copy_filec	Cstj||||||j|jd�Srf)r�	copy_treerr)rrprqrrrsZpreserve_symlinksr(rrrru]s

�zCommand.copy_treecCstj|||jd�Srf)r�	move_filer)r�srcZdstr(rrrrvfszCommand.move_filecCs ddlm}||||jd�dS)Nr)�spawnrg)Zdistutils.spawnrxr)r�cmdZsearch_pathr(rxrrrrxjsz
Command.spawnc	Cstj|||||j||d�S)N)r�owner�group)r�make_archiver)rZ	base_name�formatZroot_dirZbase_dirrzr{rrrr|os�zCommand.make_archivecCs�|durd|}t|t�r"|f}nt|ttf�s8td��|durRd|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>rK�tupler
�joinrrZnewer_grouprhr	�debug)rZinfilesrqrirjZexec_msgZskip_msgr(rrr�	make_fileus

�zCommand.make_file)Nr&)r )N)N)N)r )r)Nr )rk)r r Nr )r r rr )r )r r )NNNN)NNr )"rZ�
__module__�__qualname__rarrr#rr!r3r4r,r<rBrDrNrOrUrWr+r\r^r_r`rdrerhrlrorurvrxr|r�rrrrr
sN0






�




�
	�
	

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