Ë
    
_ßd?  ã                   ó�   — d dl mZ d dlmZ d dlmZ d dlZd dlZd dlZd dlm	Z	 g d¢Z
dd„Zdd„Z G d	„ d
e	«      Z G d„ de«      Zy)é    )Úconvert_path)Úlog)ÚDistutilsOptionErrorN)ÚCommand)Úconfig_fileÚedit_configÚoption_baseÚsetoptc                 ó\  — | dk(  ry| dk(  rKt         j                  j                  t         j                  j                  t        j
                  «      d«      S | dk(  rFt         j                  dk(  xr dxs d}t         j                  j                  t        d	|z  «      «      S t        d
| «      ‚)z�Get the filename of the distutils, local, global, or per-user config

    `kind` must be one of "local", "global", or "user"
    Úlocalz	setup.cfgÚglobalzdistutils.cfgÚuserÚposixú.Ú z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user')
ÚosÚpathÚjoinÚdirnameÚ	distutilsÚ__file__ÚnameÚ
expanduserr   Ú
ValueError)ÚkindÚdots     ú;/usr/lib/python3/dist-packages/setuptools/command/setopt.pyr   r      sŒ   € ð
 ˆw‚ØØˆxÒÜ�w‰w�|‰|œBŸG™GŸO™O¬I×,>Ñ,>Ó?ÀÓQÐQØˆv‚~Ü�g‰g˜Ñ Ò( SÒ.¨BˆÜ�w‰w×!Ñ!¤,Ð/DÀsÑ/JÓ"KÓLÐLÜ
ÐNÐPTÓ
UÐUó    c           	      ót  — t        j                  d| «       t        j                  «       }d„ |_        |j                  | g«       |j                  «       D �]  \  }}|€)t        j                  d|| «       |j                  |«       Œ2|j                  |«      s(t        j                  d|| «       |j                  |«       |j                  «       D ]˜  \  }}|€et        j                  d||| «       |j                  ||«       |j                  |«      rŒDt        j                  d|| «       |j                  |«       Œmt        j                  d|||| «       |j                  |||«       Œš �Œ t        j                  d	| «       |s't        | d
«      5 }|j                  |«       ddd«       yy# 1 sw Y   yxY w)aY  Edit a configuration file to include `settings`

    `settings` is a dictionary of dictionaries or ``None`` values, keyed by
    command/section name.  A ``None`` value means to delete the entire section,
    while a dictionary lists settings to be changed or deleted in that section.
    A setting of ``None`` means to delete that setting.
    zReading configuration from %sc                 ó   — | S ©N© )Úxs    r   ú<lambda>zedit_config.<locals>.<lambda>&   s   €  € r   NzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz
Writing %sÚw)r   ÚdebugÚconfigparserÚRawConfigParserÚoptionxformÚreadÚitemsÚinfoÚremove_sectionÚhas_sectionÚadd_sectionÚremove_optionÚoptionsÚsetÚopenÚwrite)	ÚfilenameÚsettingsÚdry_runÚoptsÚsectionr1   ÚoptionÚvalueÚfs	            r   r   r      s…  € ô ‡I�IÐ-¨xÔ8Ü×'Ñ'Ó)€DÙ"€DÔØ‡I�IˆxˆjÔØ$ŸN™NÓ,ó 5Ñˆ�Øˆ?Ü�H‰HÐ4°g¸xÔHØ×Ñ Õ(à×#Ñ# GÔ,Ü—	‘	Ð9¸7ÀHÔMØ× Ñ  Ô)Ø!(§¡£ò 5‘�˜Ø�=Ü—I‘IÐ6¸ÀÈÔRØ×&Ñ& w°Ô7ØŸ<™<¨Õ0ÜŸ™ØAÀ7ÈHôð ×+Ñ+¨GÕ4ä—I‘IØ3°W¸fÀeÈXôð —H‘H˜W f¨eÕ4ò5ð5ô. ‡H�Hˆ\˜8Ô$ÙÜ�(˜CÓ ð 	 AØ�J‰J�qŒM÷	ð 	ð ÷	ð 	ús   ÆF.Æ.F7c                   ó,   — e Zd ZdZg d¢ZddgZd„ Zd„ Zy)r	   z<Abstract base class for commands that mess with config files))úglobal-configÚgz0save options to the site-wide distutils.cfg file)úuser-configÚuz7save options to the current user's pydistutils.cfg file)z	filename=r<   z-configuration file to use (default=setup.cfg)r>   r@   c                 ó.   — d | _         d | _        d | _        y r!   )Úglobal_configÚuser_configr5   ©Úselfs    r   Úinitialize_optionszoption_base.initialize_optionsS   s   € Ø!ˆÔØˆÔØˆ�r   c                 ól  — g }| j                   r|j                  t        d«      «       | j                  r|j                  t        d«      «       | j                  �|j                  | j                  «       |s|j                  t        d«      «       t        |«      dkD  rt        d|«      ‚|\  | _        y )Nr   r   r   é   z/Must specify only one configuration file option)rC   Úappendr   rD   r5   Úlenr   )rF   Ú	filenamess     r   Úfinalize_optionszoption_base.finalize_optionsX   s›   € Øˆ	Ø×ÒØ×Ñœ[¨Ó2Ô3Ø×ÒØ×Ñœ[¨Ó0Ô1Ø�=‰=Ð$Ø×Ñ˜TŸ]™]Ô+ÙØ×Ñœ[¨Ó1Ô2Üˆy‹>˜AÒÜ&ØAÀ9óð ð %Ñˆ�r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úuser_optionsÚboolean_optionsrG   rM   r"   r   r   r	   r	   E   s%   „ ÙFò€Lð 	Øð€Oò
ó
%r   r	   c                   óh   — e Zd ZdZdZg d¢ej                  z   Zej                  dgz   Zd„ Zd„ Z	d„ Z
y)	r
   z#Save command-line options to a filez1set an option in setup.cfg or another config file))zcommand=Úczcommand to set an option for)zoption=Úozoption to set)z
set-value=Úszvalue of the option)ÚremoveÚrzremove (unset) the valuerX   c                 óf   — t         j                  | «       d | _        d | _        d | _        d | _        y r!   )r	   rG   Úcommandr:   Ú	set_valuerX   rE   s    r   rG   zsetopt.initialize_optionsw   s,   € Ü×&Ñ& tÔ,ØˆŒØˆŒØˆŒØˆ�r   c                 ó¼   — t         j                  | «       | j                  �| j                  €t	        d«      ‚| j
                  €| j                  st	        d«      ‚y y )Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r	   rM   r[   r:   r   r\   rX   rE   s    r   rM   zsetopt.finalize_options~   sS   € Ü×$Ñ$ TÔ*Ø�<‰<Ð 4§;¡;Ð#6Ü&Ð'NÓOÐOØ�>‰>Ð!¨$¯+ª+Ü&Ð'MÓNÐNð +6Ð!r   c                 óª   — t        | j                  | j                  | j                  j	                  dd«      | j
                  ii| j                  «       y )Nú-Ú_)r   r5   r[   r:   Úreplacer\   r7   rE   s    r   Úrunz
setopt.run…   s>   € ÜØ�M‰MØ�\‰\˜DŸK™K×/Ñ/°°SÓ9¸4¿>¹>ÐJÐKØ�L‰Lõ	
r   N)rN   rO   rP   rQ   Údescriptionr	   rR   rS   rG   rM   rb   r"   r   r   r
   r
   i   sE   „ Ù-àE€Kòð
 	× Ñ ñ!€Lð "×1Ñ1°X°JÑ>€OòòOó
r   r
   )r   )F)Údistutils.utilr   r   r   Údistutils.errorsr   r   r'   Ú
setuptoolsr   Ú__all__r   r   r	   r
   r"   r   r   ú<module>rh      sD   ðÝ 'Ý Ý 1Û Û 	Û å â
A€óVó&ôR!%�'ô !%ôH!
ˆ[õ !
r   