Edit File: config.cpython-36.opt-1.pyc
3 � \������������������@���s<���d�Z�ddlZddlmZ�ddlmZ�dZG�dd��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���������������@���sh���e�Zd�ZdZdZdZdZdZddde�fdgZdgZ d d��Z dd ��Zdd��Zdd��Z dd��Zdd��ZdS�)� PyPIRCCommandz;Base command that knows how to handle the .pypirc file zhttps://upload.pypi.org/legacy/�pypiNzrepository=�rzurl of repository [default: %s]� show-response�&display full response text from serverc�������������C���s���t�jjt�jjd�d�S�)zReturns rc file path.�~z.pypirc)�os�path�join� expanduser)�self��r����(/usr/lib64/python3.6/distutils/config.py�_get_rc_file&���s����zPyPIRCCommand._get_rc_filec�������������C���sH���|�j���}tjtj|tjtjB�d�d��}|jt||f���W�dQ�R�X�dS�)zCreates a default .pypirc file.i����wN)r���r ����fdopen�open�O_CREAT�O_WRONLY�write�DEFAULT_PYPIRC)r����username�password�rc�fr���r���r���� _store_pypirc*���s���� zPyPIRCCommand._store_pypircc�������������C���s���|�j���}tjj|��r�|�jd|���|�jp.|�j}|�jp:|�j}t ��}|j |��|j��}d|k�rR|jdd�}dd��|j d�D��}|g�kr�d|kr�dg}ni�S�x�|D�]�}d|i} |j|d �| d <�xHd |�jfd|�jfdfD�].\} }|j|| �r�|j|| �| | <�q�|| | <�q�W�|dk�r.||�jdfk�r.|�j| d <�| S�| d�|k�sH| d �|kr�| S�q�W�nRd|k�r�d}|j|d ��r||j|d �}n|�j}|j|d �|j|d�|||�jd�S�i�S�)zReads the .pypirc file.zUsing PyPI login from %sZ distutilsz index-serversc�������������S���s ���g�|�]}|j���d�kr|j����qS�)��)�strip)�.0�serverr���r���r���� <listcomp>>���s����z.PyPIRCCommand._read_pypirc.<locals>.<listcomp>� r���r!���r���� repository�realmr���Nzserver-login)r���r���r$���r!���r%���)r���N)r���r ���r����existsZannouncer$����DEFAULT_REPOSITORYr%���� DEFAULT_REALMr����read�sections�get�splitZ has_option)r���r���r$���r%����configr*���Z index_serversZ_serversr!���Zcurrent�key�defaultr���r���r����_read_pypirc0���sX���� zPyPIRCCommand._read_pypircc�������������C���s8���ddl�}|jdd�}|j|�d�jdd�}|j��j|�S�)z%Read and decode a PyPI HTTP response.r���Nzcontent-typez text/plain�����charset�ascii)�cgiZ getheaderZparse_headerr+���r)����decode)r���Zresponser4���Zcontent_type�encodingr���r���r����_read_pypi_responseq���s����z!PyPIRCCommand._read_pypi_responsec�������������C���s���d|�_�d|�_d|�_dS�)zInitialize options.Nr���)r$���r%���Z show_response)r���r���r���r����initialize_optionsx���s����z PyPIRCCommand.initialize_optionsc�������������C���s(���|�j�dkr|�j|�_�|�jdkr$|�j|�_dS�)zFinalizes options.N)r$���r'���r%���r(���)r���r���r���r����finalize_options~���s���� zPyPIRCCommand.finalize_options)r���Nr���)�__name__� __module__�__qualname__�__doc__r'���r(���r$���r%���Zuser_optionsZboolean_optionsr���r���r0���r7���r8���r9���r���r���r���r���r������s"����Ar���)r=���r ���Zconfigparserr���Z distutils.cmdr���r���r���r���r���r���r����<module>���s ���