a
    ´i¬"  ã                   @   s†   d dl Z d dlZd dlmZ d dlT d dlmZ d dlmZ d dl	m
Z
 d dlmZ dZd	d
„ ZdadadZdZdd„ Zddd„ZdS )é    N)ÚDEBUG)Ú*)ÚDistribution)ÚCommand)ÚPyPIRCCommand)Ú	Extensionz°usage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: %(script)s --help [cmd1 cmd2 ...]
   or: %(script)s --help-commands
   or: %(script)s cmd --help
c                 C   s   t j | ¡}ttƒ  S )N)ÚosÚpathÚbasenameÚUSAGEÚvars)Úscript_nameZscript© r   ú&/usr/lib64/python3.9/distutils/core.pyÚ	gen_usage    s    r   )Ú	distclassr   Úscript_argsÚoptionsÚnameÚversionZauthorZauthor_emailZ
maintainerZmaintainer_emailÚurlÚlicenseÚdescriptionZlong_descriptionÚkeywordsZ	platformsZclassifiersZdownload_urlZrequiresZprovidesZ	obsoletes)r   ZsourcesZinclude_dirsZdefine_macrosZundef_macrosZlibrary_dirsZ	librariesZruntime_library_dirsZextra_objectsZextra_compile_argsZextra_link_argsZ	swig_optsZexport_symbolsZdependsÚlanguagec               
   K   s  |   d¡}|r| d= nt}d| vr8tj tjd ¡| d< d| vrRtjdd … | d< z|| ƒ a}W nN ty° } z6d| vrˆt	d| ƒ‚nt	d| d |f ƒ‚W Y d }~n
d }~0 0 t
d	kr¾|S | ¡  trÚtd
ƒ | ¡  t
dkræ|S z| ¡ }W n< t�y. } z"t	t|jƒd|  ƒ‚W Y d }~n
d }~0 0 t�rFtdƒ | ¡  t
dk�rT|S |�rz| ¡  W n¬ t�y‚   t	dƒ‚Y n’ t�yÐ } z6t�r®tj d|f ¡ ‚ nt	d|f ƒ‚W Y d }~nLd }~0  ttf�y } z&t�rî‚ nt	dt|ƒ ƒ‚W Y d }~n
d }~0 0 |S )Nr   r   r   r   é   r   zerror in setup command: %szerror in %s setup command: %sÚinitz%options (after parsing config files):Úconfigz

error: %sz%options (after parsing command line):ÚcommandlineZinterruptedz
error: %s
z	error: %szerror: )Úgetr   r   r	   r
   ÚsysÚargvÚ_setup_distributionZDistutilsSetupErrorÚ
SystemExitÚ_setup_stop_afterZparse_config_filesr   ÚprintZdump_option_dictsZparse_command_lineZDistutilsArgErrorr   r   Zrun_commandsÚKeyboardInterruptÚOSErrorÚstderrÚwriteZDistutilsErrorZCCompilerErrorÚstr)ÚattrsÚklassÚdistÚmsgÚokÚexcr   r   r   Úsetup9   sd    %

ÿ,
"ÿ&r1   Úrunc                 C   sÐ   |dvrt d|f ƒ‚|atj ¡ }d| i}zxzf| tjd< |d urP|tjdd …< t| dƒ�}t| ¡ |ƒ W d   ƒ n1 s~0    Y  W |t_d an|t_d a0 W n ty¶   Y n0 t	d u rÌt
d|  ƒ‚t	S )N)r   r   r   r2   z"invalid value for 'stop_after': %rÚ__file__r   r   ÚrbzZ'distutils.core.setup()' was never called -- perhaps '%s' is not a Distutils setup script?)Ú
ValueErrorr$   r    r!   ÚcopyÚopenÚexecÚreadr#   r"   ÚRuntimeError)r   r   Z
stop_afterZ	save_argvÚgÚfr   r   r   Ú	run_setupª   s.    

.ÿ
þr=   )Nr2   )r   r    Zdistutils.debugr   Zdistutils.errorsZdistutils.distr   Zdistutils.cmdr   Zdistutils.configr   Zdistutils.extensionr   r   r   r$   r"   Zsetup_keywordsZextension_keywordsr1   r=   r   r   r   r   Ú<module>	   s   	q