
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¡ê,aÑÄ  ã                   @   sÈ   d dl Z d dlZd dlZd dlmZ zd dlZW n ek
rH   dZY nX d dlT d dlm	Z	m
Z
 d dlmZmZmZ d dlmZ d dlmZ e d¡Zd	d
„ ZG dd„ dƒZG dd„ dƒZdd„ ZdS )é    N)Úmessage_from_file)Ú*)ÚFancyGetoptÚtranslate_longopt)Úcheck_environÚ	strtoboolÚrfc822_escape©Úlog)ÚDEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$c                 C   sL   t | tƒrn<t | tƒsHt| ƒj}d|› d|› d�}t tj|¡ t| ƒ} | S )Nz
Warning: 'z' should be a list, got type 'ú')Ú
isinstanceÚstrÚlistÚtypeÚ__name__r
   ZWARN)ÚvalueZ	fieldnameÚtypenameÚmsg© r   ú3/opt/alt/python38/lib64/python3.8/distutils/dist.pyÚ_ensure_list   s    


r   c                   @   sl  e Zd ZdddddgZdZddd	d
dddddddddddddddddgZdd„ eD ƒZddiZd`d!d"„Zd#d$„ Z	dad&d'„Z
d(d)„ Zdbd*d+„Zd,d-„ Zd.d/„ Zd0d1„ Zd2d3„ Zd4d4g fd5d6„Zd7d8„ Zd9d:„ Zd;d<„ Zd=d>„ Zd?d@„ ZdAdB„ ZdcdCdD„ZdddEdF„ZdedHdI„ZejfdJdK„ZdLdM„ ZdNdO„ ZdPdQ„ Z dRdS„ Z!dTdU„ Z"dVdW„ Z#dXdY„ Z$dZd[„ Z%d\d]„ Z&d^d_„ Z'd S )fÚDistribution)ÚverboseÚvzrun verbosely (default)é   )ÚquietÚqz!run quietly (turns verbosity off))zdry-runÚnzdon't actually do anything)ÚhelpÚhzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryz£Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
)zhelp-commandsNzlist all available commands)ÚnameNzprint package name)ÚversionÚVzprint package version)ÚfullnameNzprint <package name>-<version>)ÚauthorNzprint the author's name)úauthor-emailNz print the author's email address)Ú
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)ÚcontactNz7print the maintainer's name if known, else the author's)zcontact-emailNz@print the maintainer's email address if known, else the author's)ÚurlNzprint the URL for this package)ÚlicenseNz print the license of the package)ÚlicenceNzalias for --license)ÚdescriptionNzprint the package description)zlong-descriptionNz"print the long package description)Ú	platformsNzprint the list of platforms)ÚclassifiersNzprint the list of classifiers)ÚkeywordsNzprint the list of keywords)ÚprovidesNz+print the list of packages/modules provided)ÚrequiresNz+print the list of packages/modules required)Ú	obsoletesNz0print the list of packages/modules made obsoletec                 C   s   g | ]}t |d  ƒ‘qS )r   ©r   )Ú.0Úxr   r   r   Ú
<listcomp>�   s     zDistribution.<listcomp>r   r   Nc                 C   s\  d| _ d| _d| _| jD ]}t| |dƒ qtƒ | _| jjD ] }d| }t| |t| j|ƒƒ q:i | _	d | _
d | _d | _i | _g | _d | _i | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d| _i | _i | _|�r| d¡}|d k	�r8|d= | ¡ D ]4\}}|   |¡}| ¡ D ]\}	}
d|
f||	< �q�qd|k�r~|d |d< |d= d	}t!d k	�rnt! "|¡ nt#j$ %|d
 ¡ | ¡ D ]€\}}
t&| jd| ƒ�r¶t| jd| ƒ|
ƒ nNt&| j|ƒ�rÔt| j||
ƒ n0t&| |ƒ�rît| ||
ƒ ndt'|ƒ }t! "|¡ �q†d| _(| jd k	�rP| jD ].}| )d¡�s6 �qP|dk�r d| _( �qP�q |  *¡  d S )Nr   r   Úget_Ú Úoptionszsetup scriptr+   r*   z:'licence' distribution option is deprecated; use 'license'Ú
Zset_zUnknown distribution option: %sTú-z--no-user-cfgF)+r   Údry_runr   Údisplay_option_namesÚsetattrÚDistributionMetadataÚmetadataÚ_METHOD_BASENAMESÚgetattrÚcmdclassÚcommand_packagesÚscript_nameÚscript_argsÚcommand_optionsZ
dist_filesÚpackagesZpackage_dataZpackage_dirÚ
py_modulesÚ	librariesÚheadersÚext_modulesZext_packageZinclude_dirsZ
extra_pathÚscriptsÚ
data_filesZpasswordÚcommand_objÚhave_runÚgetÚitemsÚget_option_dictÚwarningsÚwarnÚsysÚstderrÚwriteÚhasattrÚreprÚwant_user_cfgÚ
startswithÚfinalize_options)ÚselfZattrsÚattrÚbasenameZmethod_namer9   ÚcommandZcmd_optionsÚopt_dictÚoptÚvalr   ÚkeyÚargr   r   r   Ú__init__ˆ   s~    








zDistribution.__init__c                 C   s&   | j  |¡}|d kr"i  }| j |< |S ©N)rG   rQ   )r^   ra   Údictr   r   r   rS   &  s    zDistribution.get_option_dictr8   c           	      C   sÈ   ddl m} |d kr"t| j ¡ ƒ}|d k	r@|  || ¡ |d }|sV|  |d ¡ d S |D ]h}| j |¡}|d kr†|  |d|  ¡ qZ|  |d|  ¡ ||ƒ}| d¡D ]}|  |d | ¡ qªqZd S )Nr   )Úpformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r:   )Zpprintrj   ÚsortedrG   ÚkeysÚannouncerQ   Úsplit)	r^   ÚheaderÚcommandsÚindentrj   Zcmd_namerb   ÚoutÚliner   r   r   Údump_option_dicts1  s*    ÿÿzDistribution.dump_option_dictsc                 C   s¾   g }t ƒ  tj tjd j¡}tj |d¡}tj |¡rB| 	|¡ tj
dkrRd}nd}| jrˆtj tj d¡|¡}tj |¡rˆ| 	|¡ d}tj |¡r¢| 	|¡ trº|  dd	 |¡ ¡ |S )
NÚ	distutilszdistutils.cfgÚposixz.pydistutils.cfgzpydistutils.cfgú~z	setup.cfgzusing config files: %sz, )r   ÚosÚpathÚdirnamerV   ÚmodulesÚ__file__ÚjoinÚisfileÚappendr!   r[   Ú
expanduserr   rm   )r^   ÚfilesZsys_dirZsys_fileZuser_filenameZ	user_fileZ
local_filer   r   r   Úfind_config_filesM  s&    



zDistribution.find_config_filesc                 C   s¤  ddl m} tjtjkr8ddddddd	d
dddddg}ng }t|ƒ}|d krT|  ¡ }trb|  d¡ |ƒ }|D ]ˆ}tr‚|  d| ¡ | 	|¡ | 
¡ D ]V}| |¡}|  |¡}|D ]8}	|	dkr°|	|kr°| ||	¡}
|	 dd¡}	||
f||	< q°q”| ¡  qld| jk�r | jd  ¡ D ]Ž\}	\}}
| j |	¡}zF|�rDt| |t|
ƒ ƒ n(|	dk�r`t| |	t|
ƒƒ nt| |	|
ƒ W n, tk
�rš } zt|ƒ‚W 5 d }~X Y nX �qd S )Nr   )ÚConfigParserzinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-dataÚprefixzexec-prefixÚhomeÚuserÚrootz"Distribution.parse_config_files():z  reading %sr   r;   Ú_Úglobal)r   r<   )Zconfigparserrƒ   rV   r„   Úbase_prefixÚ	frozensetr‚   r   rm   ÚreadZsectionsr9   rS   rQ   Úreplacerg   rG   rR   Únegative_optr>   r   Ú
ValueErrorÚDistutilsOptionError)r^   Ú	filenamesrƒ   Zignore_optionsÚparserÚfilenameZsectionr9   rb   rc   rd   ÚsrcÚaliasr   r   r   r   Úparse_config_files}  s^             ü





zDistribution.parse_config_filesc                 C   s¾   |   ¡ }g | _t|| j ƒ}| | j¡ | ddi¡ |j| j| d�}| 	¡ }t
 | j¡ |  |¡rhd S |r†|  ||¡}|d krhd S qh| jr¬| j|t| jƒdk| jd� d S | jsºtdƒ‚dS )Nr+   r*   )ÚargsÚobjectr   ©Údisplay_optionsrp   zno commands suppliedT)Ú_get_toplevel_optionsrp   r   rš   Úset_negative_aliasesrŽ   Zset_aliasesÚgetoptrF   Zget_option_orderr
   Zset_verbosityr   Úhandle_display_optionsÚ_parse_command_optsr   Ú
_show_helpÚlenÚDistutilsArgError)r^   Ztoplevel_optionsr’   r—   Úoption_orderr   r   r   Úparse_command_line·  s.    	
þzDistribution.parse_command_linec                 C   s   | j dg S )N)zcommand-packages=Nz0list of packages that provide distutils commands)Úglobal_options©r^   r   r   r   r›   ú  s    ÿz"Distribution._get_toplevel_optionsc              
   C   sþ  ddl m} |d }t |¡s*td| ƒ‚| j |¡ z|  |¡}W n* tk
rn } zt	|ƒ‚W 5 d }~X Y nX t
||ƒs†td| ƒ‚t|dƒrœt|jtƒs¬d}t|| ƒ‚| j}t|dƒrÐ| ¡ }| |j¡ t|dƒròt|jtƒròt|jƒ}ng }| | j|j | ¡ | |¡ | |d	d … ¡\}}	t|	d
ƒ�rV|	j�rV| j|d|gd� d S t|dƒ�rÌt|jtƒ�rÌd}
|jD ]F\}}}}t|	| |¡ƒ�rzd	}
t|ƒ�r®|ƒ  ntd||f ƒ‚�qz|
�rÌd S |  |¡}t|	ƒ ¡ D ]\}}d|f||< �qâ|S )Nr   ©ÚCommandzinvalid command name '%s'z&command class %s must subclass CommandÚuser_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)rŽ   Úhelp_optionsr   r   r™   zYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) Údistutils.cmdr¨   Ú
command_reÚmatchÚ
SystemExitrp   r   Úget_command_classÚDistutilsModuleErrorr¢   Ú
issubclassZDistutilsClassErrorrY   r   r©   r   rŽ   ÚcopyÚupdaterª   Úfix_help_optionsÚset_option_tabler¥   rœ   r�   r   r    Zget_attr_nameÚcallablerS   ÚvarsrR   )r^   r’   r—   r¨   ra   Z	cmd_classr   rŽ   rª   ZoptsZhelp_option_foundZhelp_optionZshortZdescÚfuncrb   r!   r   r   r   r   rŸ     sr    


ÿ

ÿ


ÿÿþ

ÿ
þÿ
z Distribution._parse_command_optsc                 C   sP   dD ]F}t | j|ƒ}|d krqt|tƒrdd„ | d¡D ƒ}t| j||ƒ qd S )N©r/   r-   c                 S   s   g | ]}|  ¡ ‘qS r   ©Ústrip)r4   Zelmr   r   r   r6   j  s     z1Distribution.finalize_options.<locals>.<listcomp>ú,)rB   r@   r   r   rn   r>   )r^   r_   r   r   r   r   r]   `  s    
zDistribution.finalize_optionsr   c           
      C   s  ddl m} ddlm} |rR|r*|  ¡ }n| j}| |¡ | | jd ¡ t	dƒ |rt| | j
¡ | d¡ t	dƒ | jD ]z}t|tƒr˜t||ƒr˜|}	n
|  |¡}	t|	dƒrÐt|	jtƒrÐ| |	jt|	jƒ ¡ n| |	j¡ | d|	j ¡ t	dƒ qzt	|| jƒƒ d S )	Nr   ©Ú	gen_usager§   z
Global options:r8   zKInformation display options (just display information, ignore any commands)rª   zOptions for '%s' command:)Údistutils.corer¾   r«   r¨   r›   r¥   rµ   Z
print_helpÚcommon_usageÚprintrš   rp   r   r   r±   r¯   rY   rª   r   r©   r´   r   rE   )
r^   r’   r¥   rš   rp   r¾   r¨   r9   ra   Úklassr   r   r   r    m  s:    

ÿ



ÿÿ
zDistribution._show_helpc           	      C   sÊ   ddl m} | jr4|  ¡  tdƒ t|| jƒƒ dS d}i }| jD ]}d||d < qB|D ]l\}}|rX| |¡rXt|ƒ}t	| j
d| ƒƒ }|dkr td |¡ƒ n |dkr¸td	 |¡ƒ nt|ƒ d}qX|S )
Nr   r½   r8   r   r7   r¹   r¼   )r.   r0   r1   r2   r:   )r¿   r¾   Zhelp_commandsÚprint_commandsrÁ   rE   rš   rQ   r   rB   r@   r}   )	r^   r£   r¾   Zany_display_optionsZis_display_optionÚoptionrc   rd   r   r   r   r   rž   Ÿ  s*    
z#Distribution.handle_display_optionsc              	   C   sj   t |d ƒ |D ]T}| j |¡}|s.|  |¡}z
|j}W n tk
rP   d}Y nX t d|||f ƒ qd S )Nú:ú(no description available)z
  %-*s  %s)rÁ   rC   rQ   r¯   r,   ÚAttributeError)r^   rp   ro   Ú
max_lengthÚcmdrÂ   r,   r   r   r   Úprint_command_listÇ  s    


zDistribution.print_command_listc                 C   sž   dd l }|jj}i }|D ]}d||< qg }| j ¡ D ]}| |¡s4| |¡ q4d}|| D ]}t|ƒ|krZt|ƒ}qZ|  |d|¡ |ršt	ƒ  |  |d|¡ d S )Nr   r   zStandard commandszExtra commands)
Údistutils.commandra   Ú__all__rC   rl   rQ   r   r¡   rÊ   rÁ   )r^   ru   Ústd_commandsÚis_stdrÉ   Úextra_commandsrÈ   r   r   r   rÃ   Ø  s.    


þþzDistribution.print_commandsc           	   	   C   s°   dd l }|jj}i }|D ]}d||< qg }| j ¡ D ]}| |¡s4| |¡ q4g }|| D ]P}| j |¡}|sx|  |¡}z
|j}W n t	k
rš   d}Y nX | ||f¡ qZ|S )Nr   r   rÆ   )
rË   ra   rÌ   rC   rl   rQ   r   r¯   r,   rÇ   )	r^   ru   rÍ   rÎ   rÉ   rÏ   ÚrvrÂ   r,   r   r   r   Úget_command_listù  s(    	




zDistribution.get_command_listc                 C   sN   | j }t|tƒsJ|d krd}dd„ | d¡D ƒ}d|krD| dd¡ || _ |S )Nr8   c                 S   s   g | ]}|d kr|  ¡ ‘qS )r8   rº   )r4   Zpkgr   r   r   r6   !  s      z5Distribution.get_command_packages.<locals>.<listcomp>r¼   zdistutils.commandr   )rD   r   r   rn   Úinsert)r^   Zpkgsr   r   r   Úget_command_packages  s    
z!Distribution.get_command_packagesc              	   C   s¸   | j  |¡}|r|S |  ¡ D ]Š}d||f }|}zt|ƒ tj| }W n tk
r^   Y qY nX zt||ƒ}W n& tk
r”   t	d|||f ƒ‚Y nX || j |< |  S t	d| ƒ‚d S )Nz%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s')
rC   rQ   rÓ   Ú
__import__rV   r{   ÚImportErrorrB   rÇ   r°   )r^   ra   rÂ   ZpkgnameZmodule_nameZ
klass_nameÚmoduler   r   r   r¯   '  s,    
ÿÿ

zDistribution.get_command_classc                 C   sl   | j  |¡}|sh|rhtr&|  d| ¡ |  |¡}|| ƒ }| j |< d| j|< | j |¡}|rh|  ||¡ |S )Nz<Distribution.get_command_obj(): creating '%s' command objectr   )rO   rQ   r   rm   r¯   rP   rG   Ú_set_command_options)r^   ra   ZcreateÚcmd_objrÂ   r9   r   r   r   Úget_command_objM  s    ÿ

zDistribution.get_command_objc                 C   s\  |  ¡ }|d kr|  |¡}tr,|  d| ¡ | ¡ D �] \}\}}trZ|  d|||f ¡ zdd„ |jD ƒ}W n tk
r†   g }Y nX z
|j}W n tk
rª   i }Y nX z|t|t	ƒ}	||krÜ|	rÜt
||| t|ƒ ƒ nJ||krú|	rút
||t|ƒƒ n,t||ƒ�rt
|||ƒ ntd|||f ƒ‚W q4 tk
�rT }
 zt|
ƒ‚W 5 d }
~
X Y q4X q4d S )Nz#  setting options for '%s' command:z    %s = %s (from %s)c                 S   s   g | ]}t |ƒ‘qS r   r3   )r4   Úor   r   r   r6   |  s   ÿz5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')Úget_command_namerS   r   rm   rR   Zboolean_optionsrÇ   rŽ   r   r   r>   r   rY   r�   r�   )r^   rO   Zoption_dictÚcommand_namerÄ   Úsourcer   Z	bool_optsZneg_optZ	is_stringr   r   r   r   r×   h  sF    	

ÿÿ




ÿÿz!Distribution._set_command_optionsr   c                 C   s|   ddl m} t||ƒs&|}|  |¡}n| ¡ }|js8|S | ¡  d|_d| j|< |  |¡ |rx| 	¡ D ]}|  
||¡ qf|S )Nr   r§   )r«   r¨   r   rÙ   rÛ   Z	finalizedZinitialize_optionsrP   r×   Zget_sub_commandsÚreinitialize_command)r^   ra   Zreinit_subcommandsr¨   rÜ   Úsubr   r   r   rÞ   ”  s    


z!Distribution.reinitialize_commandc                 C   s   t   ||¡ d S rh   r	   )r^   r   Úlevelr   r   r   rm   ½  s    zDistribution.announcec                 C   s   | j D ]}|  |¡ qd S rh   )rp   Úrun_command)r^   rÉ   r   r   r   Úrun_commandsÀ  s    
zDistribution.run_commandsc                 C   sD   | j  |¡rd S t d|¡ |  |¡}| ¡  | ¡  d| j |< d S )Nz
running %sr   )rP   rQ   r
   ÚinforÙ   Zensure_finalizedÚrun)r^   ra   rØ   r   r   r   rá   Ê  s    	
zDistribution.run_commandc                 C   s   t | jp| jpg ƒdkS ©Nr   )r¡   rH   rI   r¦   r   r   r   Úhas_pure_modulesÞ  s    zDistribution.has_pure_modulesc                 C   s   | j ot| j ƒdkS rå   )rL   r¡   r¦   r   r   r   Úhas_ext_modulesá  s    zDistribution.has_ext_modulesc                 C   s   | j ot| j ƒdkS rå   )rJ   r¡   r¦   r   r   r   Úhas_c_librariesä  s    zDistribution.has_c_librariesc                 C   s   |   ¡ p|  ¡ S rh   )ræ   rç   r¦   r   r   r   Úhas_modulesç  s    zDistribution.has_modulesc                 C   s   | j ot| j ƒdkS rå   )rK   r¡   r¦   r   r   r   Úhas_headersê  s    zDistribution.has_headersc                 C   s   | j ot| j ƒdkS rå   )rM   r¡   r¦   r   r   r   Úhas_scriptsí  s    zDistribution.has_scriptsc                 C   s   | j ot| j ƒdkS rå   )rN   r¡   r¦   r   r   r   Úhas_data_filesð  s    zDistribution.has_data_filesc                 C   s   |   ¡ o|  ¡  o|  ¡  S rh   )ræ   rç   rè   r¦   r   r   r   Úis_pureó  s
    ÿþzDistribution.is_pure)N)NNr8   )N)r   )N)r   )(r   Ú
__module__Ú__qualname__r¥   rÀ   rš   r=   rŽ   rg   rS   rt   r‚   r–   r¤   r›   rŸ   r]   r    rž   rÊ   rÃ   rÑ   rÓ   r¯   rÙ   r×   rÞ   r
   ÚINFOrm   râ   rá   ræ   rç   rè   ré   rê   rë   rì   rí   r   r   r   r   r   ,   s€   û	×,
 
0
:C[ÿ
2(!"&

,
)
r   c                   @   s  e Zd ZdZdAdd„Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ ZeZd#d$„ Zd%d&„ Zd'd(„ Zd)d*„ Zd+d,„ Zd-d.„ Zd/d0„ Zd1d2„ Zd3d4„ Zd5d6„ Zd7d8„ Zd9d:„ Z d;d<„ Z!d=d>„ Z"d?d@„ Z#dS )Br?   )r!   r"   r%   Úauthor_emailr'   Úmaintainer_emailr)   r*   r,   Úlong_descriptionr/   r-   r$   r(   Zcontact_emailr.   Údownload_urlr0   r1   r2   Nc                 C   s‚   |d k	r|   t|ƒ¡ nfd | _d | _d | _d | _d | _d | _d | _d | _	d | _
d | _d | _d | _d | _d | _d | _d | _d | _d S rh   )Úread_pkg_fileÚopenr!   r"   r%   rñ   r'   rò   r)   r*   r,   ró   r/   r-   r.   rô   r0   r1   r2   )r^   ry   r   r   r   rg     s&    zDistributionMetadata.__init__c                    s  t |ƒ‰ ‡ fdd„}‡ fdd„}ˆ d }|dƒ| _|dƒ| _|dƒ| _|d	ƒ| _d | _|d
ƒ| _d | _|dƒ| _|dƒ| _	dˆ krŽ|dƒ| _
nd | _
|dƒ| _|dƒ| _dˆ krÀ|dƒ d¡| _|dƒ| _|dƒ| _|dkrü|dƒ| _|dƒ| _|dƒ| _nd | _d | _d | _d S )Nc                    s   ˆ |  }|dkrd S |S ©NZUNKNOWNr   )r!   r   ©r   r   r   Ú_read_field(  s    z7DistributionMetadata.read_pkg_file.<locals>._read_fieldc                    s   ˆ   | d ¡}|g krd S |S rh   )Zget_all)r!   Úvaluesrø   r   r   Ú
_read_list.  s    z6DistributionMetadata.read_pkg_file.<locals>._read_listzmetadata-versionr!   r"   Zsummaryr%   r&   z	home-pager*   zdownload-urlr,   r/   r¼   ÚplatformZ
classifierú1.1r1   r0   r2   )r   r!   r"   r,   r%   r'   rñ   rò   r)   r*   rô   ró   rn   r/   r-   r.   r1   r0   r2   )r^   Úfilerù   rû   Zmetadata_versionr   rø   r   rõ   $  s:    












z"DistributionMetadata.read_pkg_filec              	   C   s2   t tj |d¡ddd��}|  |¡ W 5 Q R X d S )NzPKG-INFOÚwzUTF-8)Úencoding)rö   rx   ry   r}   Úwrite_pkg_file)r^   Zbase_dirZpkg_infor   r   r   Úwrite_pkg_infoX  s
    ÿz#DistributionMetadata.write_pkg_infoc                 C   sb  d}| j s"| js"| js"| js"| jr&d}| d| ¡ | d|  ¡  ¡ | d|  ¡  ¡ | d|  ¡  ¡ | d|  	¡  ¡ | d|  
¡  ¡ | d	|  ¡  ¡ | d
|  ¡  ¡ | jrÈ| d| j ¡ t|  ¡ ƒ}| d| ¡ d |  ¡ ¡}|�r| d| ¡ |  |d|  ¡ ¡ |  |d|  ¡ ¡ |  |d|  ¡ ¡ |  |d|  ¡ ¡ |  |d|  ¡ ¡ d S )Nz1.0rý   zMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
r¼   zKeywords: %s
ZPlatformZ
ClassifierZRequiresZProvidesZ	Obsoletes)r0   r1   r2   r.   rô   rX   Úget_nameÚget_versionÚget_descriptionÚget_urlÚget_contactÚget_contact_emailÚget_licenser   Úget_long_descriptionr}   Úget_keywordsÚ_write_listÚget_platformsÚget_classifiersÚget_requiresÚget_providesÚget_obsoletes)r^   rþ   r"   Z	long_descr/   r   r   r   r  _  s6    ÿÿz#DistributionMetadata.write_pkg_filec                 C   s    |D ]}|  d||f ¡ qd S )Nz%s: %s
)rX   )r^   rþ   r!   rú   r   r   r   r   r  �  s    z DistributionMetadata._write_listc                 C   s
   | j pdS r÷   )r!   r¦   r   r   r   r  ‡  s    zDistributionMetadata.get_namec                 C   s
   | j pdS )Nz0.0.0)r"   r¦   r   r   r   r  Š  s    z DistributionMetadata.get_versionc                 C   s   d|   ¡ |  ¡ f S )Nz%s-%s)r  r  r¦   r   r   r   Úget_fullname�  s    z!DistributionMetadata.get_fullnamec                 C   s
   | j pdS r÷   )r%   r¦   r   r   r   Ú
get_author�  s    zDistributionMetadata.get_authorc                 C   s
   | j pdS r÷   )rñ   r¦   r   r   r   Úget_author_email“  s    z%DistributionMetadata.get_author_emailc                 C   s
   | j pdS r÷   )r'   r¦   r   r   r   Úget_maintainer–  s    z#DistributionMetadata.get_maintainerc                 C   s
   | j pdS r÷   )rò   r¦   r   r   r   Úget_maintainer_email™  s    z)DistributionMetadata.get_maintainer_emailc                 C   s   | j p| jpdS r÷   )r'   r%   r¦   r   r   r   r  œ  s    z DistributionMetadata.get_contactc                 C   s   | j p| jpdS r÷   )rò   rñ   r¦   r   r   r   r  Ÿ  s    z&DistributionMetadata.get_contact_emailc                 C   s
   | j pdS r÷   )r)   r¦   r   r   r   r  ¢  s    zDistributionMetadata.get_urlc                 C   s
   | j pdS r÷   )r*   r¦   r   r   r   r	  ¥  s    z DistributionMetadata.get_licensec                 C   s
   | j pdS r÷   )r,   r¦   r   r   r   r  ©  s    z$DistributionMetadata.get_descriptionc                 C   s
   | j pdS r÷   )ró   r¦   r   r   r   r
  ¬  s    z)DistributionMetadata.get_long_descriptionc                 C   s
   | j pg S rh   )r/   r¦   r   r   r   r  ¯  s    z!DistributionMetadata.get_keywordsc                 C   s   t |dƒ| _d S )Nr/   )r   r/   ©r^   r   r   r   r   Úset_keywords²  s    z!DistributionMetadata.set_keywordsc                 C   s   | j p
dgS r÷   )r-   r¦   r   r   r   r  µ  s    z"DistributionMetadata.get_platformsc                 C   s   t |dƒ| _d S )Nr-   )r   r-   r  r   r   r   Úset_platforms¸  s    z"DistributionMetadata.set_platformsc                 C   s
   | j pg S rh   )r.   r¦   r   r   r   r  »  s    z$DistributionMetadata.get_classifiersc                 C   s   t |dƒ| _d S )Nr.   )r   r.   r  r   r   r   Úset_classifiers¾  s    z$DistributionMetadata.set_classifiersc                 C   s
   | j pdS r÷   )rô   r¦   r   r   r   Úget_download_urlÁ  s    z%DistributionMetadata.get_download_urlc                 C   s
   | j pg S rh   )r1   r¦   r   r   r   r  Å  s    z!DistributionMetadata.get_requiresc                 C   s,   dd l }|D ]}|j |¡ qt|ƒ| _d S rå   )Údistutils.versionpredicateÚversionpredicateÚVersionPredicater   r1   ©r^   r   ru   r   r   r   r   Úset_requiresÈ  s    z!DistributionMetadata.set_requiresc                 C   s
   | j pg S rh   )r0   r¦   r   r   r   r  Î  s    z!DistributionMetadata.get_providesc                 C   s6   dd„ |D ƒ}|D ]}dd l }|j |¡ q|| _d S )Nc                 S   s   g | ]}|  ¡ ‘qS r   rº   )r4   r   r   r   r   r6   Ò  s     z5DistributionMetadata.set_provides.<locals>.<listcomp>r   )r  r  Zsplit_provisionr0   )r^   r   r   ru   r   r   r   Úset_providesÑ  s
    z!DistributionMetadata.set_providesc                 C   s
   | j pg S rh   )r2   r¦   r   r   r   r  Ø  s    z"DistributionMetadata.get_obsoletesc                 C   s,   dd l }|D ]}|j |¡ qt|ƒ| _d S rå   )r  r  r  r   r2   r  r   r   r   Úset_obsoletesÛ  s    z"DistributionMetadata.set_obsoletes)N)$r   rî   rï   rA   rg   rõ   r  r  r  r  r  r  r  r  r  r  r  r  r  r	  Zget_licencer  r
  r  r  r  r  r  r  r  r  r   r  r!  r  r"  r   r   r   r   r?   ÿ  sB   	
4"r?   c                 C   s$   g }| D ]}|  |dd… ¡ q|S )Nr   é   )r   )r9   Znew_optionsZ
help_tupler   r   r   r´   á  s    r´   )rV   rx   ÚreZemailr   rT   rÕ   Zdistutils.errorsZdistutils.fancy_getoptr   r   Zdistutils.utilr   r   r   ru   r
   Zdistutils.debugr   Úcompiler¬   r   r   r?   r´   r   r   r   r   Ú<module>   s2   

       Z c