<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>

Yf                 @   sR   d  Z  d d l Z d d l m Z d d l m Z d Z Gd d   d e  Z d S)zdistutils.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               @   s   e  Z d  Z d Z d Z d Z d Z d Z d d d e f d g Z d g Z	 d
 d   Z
 d d   Z d d   Z d d   Z d d   Z d d   Z d S)PyPIRCCommandz;Base command that knows how to handle the .pypirc file
    zhttps://upload.pypi.org/legacy/pypiNzrepository=rzurl of repository [default: %s]show-response&display full response text from serverc             C   s   t  j j t  j j d  d  S)zReturns rc file path.~z.pypirc)ospathjoin
expanduser)self r   5/opt/alt/python35/lib64/python3.5/distutils/config.py_get_rc_file&   s    zPyPIRCCommand._get_rc_filec             C   s\   |  j    } t j t j | t j t j Bd  d   } | j t | | f  Wd QRXd S)zCreates 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    .zPyPIRCCommand._store_pypircc          
   C   sM  |  j    } t j j |  rI|  j d |  |  j p> |  j } |  j pP |  j } t	   } | j
 |  | j   } d | k r| j d d  } d d   | j d  D } | g  k r d | k r d g } n i  Sxo| D] } d | i }	 | j | d	  |	 d	 <xd d
 |  j f d |  j f d f D]A \ }
 } | j | |
  r_| j | |
  |	 |
 <q(| |	 |
 <q(W| d k r| |  j d f k r|  j |	 d
 <|	 S|	 d | k s|	 d
 | k r |	 Sq Wn d | k rId } | j | d
  r| j | d
  } n	 |  j } d	 | j | d	  d | j | d  d
 | d | d |  j i Si  S)zReads the .pypirc file.zUsing PyPI login from %sZ	distutilszindex-serversc             S   s.   g  |  ]$ } | j    d  k r | j     q S) )strip).0serverr   r   r   
<listcomp>>   s   	 z.PyPIRCCommand._read_pypirc.<locals>.<listcomp>
r   r!   r   
repositoryrealmr   Nzserver-login)r   N)r   r
   r   existsZannouncer$   DEFAULT_REPOSITORYr%   DEFAULT_REALMr   readsectionsgetsplitZ
has_option)r   r   r$   r%   configr*   Zindex_serversZ_serversr!   Zcurrentkeydefaultr   r   r   _read_pypirc0   sX    				zPyPIRCCommand._read_pypircc             C   sP   d d l  } | j d d  } | j |  d j d d  } | j   j |  S)z%Read and decode a PyPI HTTP response.r   Nzcontent-typez
text/plain   charsetascii)cgiZ	getheaderZparse_headerr+   r)   decode)r   Zresponser4   Zcontent_typeencodingr   r   r   _read_pypi_responseq   s    z!PyPIRCCommand._read_pypi_responsec             C   s   d |  _  d |  _ d |  _ d S)zInitialize options.Nr   )r$   r%   Zshow_response)r   r   r   r   initialize_optionsx   s    		z PyPIRCCommand.initialize_optionsc             C   s:   |  j  d k r |  j |  _  |  j d k r6 |  j |  _ d S)zFinalizes options.N)r$   r'   r%   r(   )r   r   r   r   finalize_options~   s    zPyPIRCCommand.finalize_options)r   Nr   )__name__
__module____qualname____doc__r'   r(   r$   r%   Zuser_optionsZboolean_optionsr   r   r0   r7   r8   r9   r   r   r   r   r      s"    		Ar   )r=   r
   Zconfigparserr   Zdistutils.cmdr   r   r   r   r   r   r   <module>   s
   
