Your IP : 18.188.130.151


Current Path : /opt/alt/python310/lib64/python3.10/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/distutils/__pycache__/cmd.cpython-310.opt-2.pyc

o

6��f�F�@s`	ddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZGdd�d�ZdS)�N)�DistutilsOptionError)�util�dir_util�	file_util�archive_util�dep_util��logc@s0eZdZ	gZdd�Zdd�Zdd�Zdd�Zd	d
�ZdBd
d�Z	dd�Z
dCdd�Zdd�ZdDdd�Z
dDdd�Zdd�Z	dDdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdCd&d'�ZdEd)d*�Zd+d,�Zd-d.�Zd/d0�ZdFd1d2�ZdGd4d5�Z		dHd6d7�Z		dId8d9�ZdCd:d;�ZdJd<d=�Z		dKd>d?�Z 	dLd@dA�Z!dS)M�CommandcCsd	ddlm}t||�std��|jturtd��||_|��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�4/opt/alt/python310/lib64/python3.10/distutils/cmd.py�__init__/s



zCommand.__init__cCs6|dkrt|d|�}|durt|j|�S|St|��)N�dry_run�_)�getattrr�AttributeError)r�attrZmyvalrrr�__getattr___szCommand.__getattr__cCs|js|��d|_dS�N�)r�finalize_options�rrrr�ensure_finalizedis
zCommand.ensure_finalizedcC�	td|j���Nz,abstract method -- subclass %s must override�rrr#rrrr{�	�zCommand.initialize_optionscCr%r&r'r#rrrr"�s
�zCommand.finalize_optionsN�cCs�ddlm}|durd|��}|j||tjd�|d}|jD])\}}}|�|�}|ddkr7|dd�}t||�}|j|d||ftjd�q!dS)	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_optionscCr%r&r'r#rrr�run�r(zCommand.runr!cCs	t�||�dS�Nr)r�msgr+rrrr/�szCommand.announcecCs,	ddlm}|rt|�tj��dSdS)Nr)�DEBUG)Zdistutils.debugr:�print�sys�stdout�flush)rr9r:rrr�debug_print�s�zCommand.debug_printcCsBt||�}|durt|||�|St|t�std|||f��|S)Nz'%s' must be a %s (got `%s`))r�setattrr�strr)rr4�what�default�valrrr�_ensure_stringlike�s

�zCommand._ensure_stringlikecCs	|�|d|�dS)N�string)rE)rr4rCrrr�
ensure_string�szCommand.ensure_stringcCst	t||�}|durdSt|t�rt||t�d|��dSt|t�r,tdd�|D��}nd}|s8td||f��dS)Nz,\s*|\s+css�|]}t|t�VqdSr8)rrA)�.0�vrrr�	<genexpr>�s�z-Command.ensure_string_list.<locals>.<genexpr>Fz''%s' must be a list of strings (got %r))	rrrAr@�re�split�list�allr)rr4rD�okrrr�ensure_string_list�s 


���zCommand.ensure_string_listcCs:|�|||�}|dur||�std|||f��dSdS)Nzerror in '%s' option: )rEr)rr4ZtesterrBZ	error_fmtrCrDrrr�_ensure_tested_string�s��zCommand._ensure_tested_stringcCs	|�|tjjdd�dS)N�filenamez$'%s' does not exist or is not a file)rQ�os�path�isfile�rr4rrr�ensure_filename�s
�zCommand.ensure_filenamecCs|�|tjjdd�dS)Nzdirectory namez)'%s' does not exist or is not a directory)rQrSrT�isdirrVrrr�ensure_dirnames�zCommand.ensure_dirnamecCst|d�r|jS|jjS)N�command_name)�hasattrrZr�__name__r#rrrr.	s
zCommand.get_command_namecGsH	|j�|�}|��|D]\}}t||�dur!t||t||��q
dSr8)r�get_command_objr$rr@)rZsrc_cmdZoption_pairsZsrc_cmd_objZ
src_optionZ
dst_optionrrr�set_undefined_optionss��zCommand.set_undefined_optionscCs	|j�||�}|��|Sr8)rr]r$)r�commandZcreateZcmd_objrrr�get_finalized_command$szCommand.get_finalized_commandrcCs|j�||�Sr8)r�reinitialize_command)rr_Zreinit_subcommandsrrrra0s�zCommand.reinitialize_commandcCs	|j�|�dSr8)r�run_command)rr_rrrrb4szCommand.run_commandcCs4	g}|jD]\}}|dus||�r|�|�q|Sr8)�sub_commands�append)rZcommandsZcmd_name�methodrrr�get_sub_commands;s
�zCommand.get_sub_commandscCst�d|��|�dS)Nzwarning: %s: %s
)r	�warnr.)rr9rrrrgK�zCommand.warncCstj||||jd�dS�N�r)r�executer)r�func�argsr9r+rrrrkNszCommand.execute�cCstj|||jd�dSri)r�mkpathr)r�name�moderrrroQrhzCommand.mkpathc	Cs 	tj|||||j||jd�Sri)r�	copy_filerr)r�infile�outfile�
preserve_mode�preserve_times�linkr+rrrrrTs


�zCommand.copy_filec	Cs 	tj||||||j|jd�Sri)r�	copy_treerr)rrsrtrurvZpreserve_symlinksr+rrrrx]s


�zCommand.copy_treecCs	tj|||jd�Sri)r�	move_filer)r�srcZdstr+rrrryfszCommand.move_filecCs"	ddlm}||||jd�dS)Nr)�spawnrj)Zdistutils.spawnr{r)r�cmdZsearch_pathr+r{rrrr{jsz
Command.spawnc	Cstj|||||j||d�S)N)r�owner�group)r�make_archiver)rZ	base_name�formatZroot_dirZbase_dirr}r~rrrros�zCommand.make_archivecCs�	|dur	d|}t|t�r|f}nt|ttf�std��|dur*d|d�|�f}|js3t�||�r=|�	||||�dSt
�|�dS)Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating %s from %sz, )rrArM�tupler
�joinrrZnewer_grouprkr	�debug)rZinfilesrtrlrmZexec_msgZskip_msgr+rrr�	make_fileus
�zCommand.make_file)Nr))r!r8)rr )rn)r!r!Nr!)r!r!rr!)r!r!)NNNN)NNr!)"r\�
__module__�__qualname__rcrrr$rr"r6r7r/r?rErGrPrQrWrYr.r^r`rarbrfrgrkrorrrxryr{rr�rrrrr
sR0







�




�	
�
	

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

?>