�
���c/ � �J � d Z ddlZddlmZ ddlmZ dZ G d� de� � ZdS ) z�distutils.pypirc
Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
� N)�RawConfigParser� )�CommandzE[distutils]
index-servers =
pypi
[pypi]
username:%s
password:%s
c �` � e Zd ZdZdZdZdZdZdddez fdgZd gZ d
� Z
d� Zd� Zd
� Z
d� Zd� ZdS )�
PyPIRCCommandz6Base command that knows how to handle the .pypirc filezhttps://upload.pypi.org/legacy/�pypiNzrepository=�rzurl of repository [default: %s])�
show-responseNz&display full response text from serverr
c �| � t j � t j � d� � d� � S )zReturns rc file path.�~z.pypirc)�os�path�join�
expanduser��selfs �>/usr/lib/python3/dist-packages/setuptools/_distutils/config.py�_get_rc_filezPyPIRCCommand._get_rc_file% s( � ��w�|�|�B�G�.�.�s�3�3�Y�?�?�?� c � � | � � � }t j t j |t j t j z d� � d� � 5 }|� t ||fz � � ddd� � dS # 1 swxY w Y dS )zCreates a default .pypirc file.i� �wN)r r
�fdopen�open�O_CREAT�O_WRONLY�write�DEFAULT_PYPIRC)r �username�password�rc�fs r �
_store_pypirczPyPIRCCommand._store_pypirc) s� � �
�
�
�
�
��
�Y�r�w�r�2�:���#;�U�C�C�S�
I�
I� ;�Q�
�G�G�N�h��%9�9�:�:�:� ;� ;� ;� ;� ;� ;� ;� ;� ;� ;� ;� ;���� ;� ;� ;� ;� ;� ;s � B�B� Bc �� � | � � � }t j � |� � �r�| � d|z � � | j p| j }t � � }|� |� � |� � � }d|v r�|�
dd� � }d� |� d� � D � � }|g k r
d|v rdg}ni S |D ]�}d|i}|�
|d� � |d< |