Ë
    
_ßd/  ã                   óB   — d Z ddlZddlmZ ddlmZ dZ G d„ de«      Zy)	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 Zd ZdZdZdZdZdZdddez  fdgZd	gZ	d
„ Z
d„ Zd„ Zd„ Zd„ Zd„ Zy)ÚPyPIRCCommandz6Base command that knows how to handle the .pypirc filezhttps://upload.pypi.org/legacy/ÚpypiNzrepository=Úrzurl of repository [default: %s])úshow-responseNz&display full response text from serverr
   c                 ó|   — t         j                  j                  t         j                  j                  d«      d«      S )zReturns rc file path.ú~z.pypirc)ÚosÚpathÚjoinÚ
expanduser©Úselfs    ú>/usr/lib/python3/dist-packages/setuptools/_distutils/config.pyÚ_get_rc_filezPyPIRCCommand._get_rc_file%   s&   € ä�w‰w�|‰|œBŸG™G×.Ñ.¨sÓ3°YÓ?Ð?ó    c                 ó  — | j                  «       }t        j                  t        j                  |t        j                  t        j
                  z  d«      d«      5 }|j                  t        ||fz  «       ddd«       y# 1 sw Y   yxY w)zCreates a default .pypirc file.i€  ÚwN)r   r   ÚfdopenÚopenÚO_CREATÚO_WRONLYÚwriteÚDEFAULT_PYPIRC)r   ÚusernameÚpasswordÚrcÚfs        r   Ú_store_pypirczPyPIRCCommand._store_pypirc)   se   € à×ÑÓ ˆÜ�Y‰Y”r—w‘w˜r¤2§:¡:´·±Ñ#;¸UÓCÀSÓIð 	;ÈQØ�G‰G”N h°Ð%9Ñ9Ô:÷	;÷ 	;ñ 	;ús   ÁA?Á?Bc                 ó  — | j                  «       }t        j                  j                  |«      �r×| j	                  d|z  «       | j
                  xs | j                  }t        «       }|j                  |«       |j                  «       }d|v �r|j                  dd«      }|j                  d«      D �cg c]%  }|j                  «       dk7  r|j                  «       ‘Œ' }}|g k(  r
d|v rdg}ni S |D ]©  }d|i}|j                  |d«      |d<   d	| j                  fd
| j                  fdfD ]2  \  }	}
|j                  ||	«      r|j                  ||	«      ||	<   Œ.|
||	<   Œ4 |dk(  r#|| j                  dfv r| j                  |d	<   |c S |d   |k(  s	|d	   |k(  sŒ§|c S  i S d|v red}|j                  |d	«      r|j                  |d	«      }n| j                  }|j                  |d«      |j                  |d«      ||| j                  dœS i S c c}w )zReads the .pypirc file.zUsing PyPI login from %sÚ	distutilszindex-serversú
Ú r   Úserverr   Ú
repositoryÚrealm)r   Nzserver-loginr   )r   r   r(   r'   r)   )r   r   r   ÚexistsÚannouncer(   ÚDEFAULT_REPOSITORYr   ÚreadÚsectionsÚgetÚsplitÚstripÚDEFAULT_REALMÚ
has_option)r   r    r(   Úconfigr.   Úindex_serversr'   Ú_serversÚcurrentÚkeyÚdefaults              r   Ú_read_pypirczPyPIRCCommand._read_pypirc/   sK  € à×ÑÓ ˆÜ�7‰7�>‰>˜"ÕØ�M‰MÐ4°rÑ9Ô:ØŸ™ÒC¨D×,CÑ,CˆJä$Ó&ˆFØ�K‰K˜ŒOØ—‘Ó(ˆHØ˜hÒ&à &§
¡
¨;¸Ó H�ð #0×"5Ñ"5°dÓ";öàØ—|‘|“~¨Ò+ð —L‘L•Nð�ð ð
 ˜r’>à Ñ)Ø$* 8™ð  "˜	Ø&ò '�FØ'¨Ð0�GØ*0¯*©*°V¸ZÓ*H�G˜JÑ'ð & t×'>Ñ'>Ð?Ø  $×"4Ñ"4Ð5Ø*ð)ò 3™˜˜Wð
 "×,Ñ,¨V°SÔ9Ø+1¯:©:°f¸cÓ+B˜G CšLà+2˜G CšLð3ð  Ò'¨JØ×/Ñ/Øð;ñ -ð 15×0GÑ0G˜ Ñ-Ø&šð   Ñ)¨ZÒ7Ø" <Ñ0°JÓ>à&šð;'ðZ ˆ	ð   8Ñ+à'�Ø×$Ñ$ V¨\Ô:Ø!'§¡¨F°LÓ!A‘Jà!%×!8Ñ!8�Jà &§
¡
¨6°:Ó >Ø &§
¡
¨6°:Ó >Ø",Ø$Ø!×/Ñ/ñð ð ˆ	ùòus   Â4*H
c                 ó´   — 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/plainr   ÚcharsetÚascii)ÚcgiÚ	getheaderÚparse_headerr/   r-   Údecode)r   Úresponser>   Úcontent_typeÚencodings        r   Ú_read_pypi_responsez!PyPIRCCommand._read_pypi_responsex   sP   € ãà×)Ñ)¨.¸,ÓGˆØ×#Ñ# LÓ1°!Ñ4×8Ñ8¸ÀGÓLˆØ�}‰}‹×%Ñ% hÓ/Ð/r   c                 ó.   — d| _         d| _        d| _        y)zInitialize options.Nr   )r(   r)   Úshow_responser   s    r   Úinitialize_optionsz PyPIRCCommand.initialize_options€   s   € àˆŒØˆŒ
ØˆÕr   c                 óz   — | j                   €| j                  | _         | j                  €| j                  | _        yy)zFinalizes options.N)r(   r,   r)   r2   r   s    r   Úfinalize_optionszPyPIRCCommand.finalize_options†   s5   € à�?‰?Ð"Ø"×5Ñ5ˆDŒOØ�:‰:ÐØ×+Ñ+ˆD�Jð r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r,   r2   r(   r)   Úuser_optionsÚboolean_optionsr   r"   r:   rE   rH   rJ   © r   r   r   r      sb   „ Ù@à:ÐØ€MØ€JØ€Eð 
˜Ð>ÐASÑSÐTØIð€Lð
 'Ð'€Oò@ò;òGòR0òó,r   r   )rN   r   Úconfigparserr   Úcmdr   r   r   rQ   r   r   ú<module>rT      s*   ðñó
 
Ý (å ð€ôu,�Gõ u,r   