
    ǆij                     P    S r SSKrSSKrSSKJr  SSKJr  Sr " S S\5      r	S	 r
g)
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                   h    \ rS rSrSrSrSrSrSrSSS\ S	34S
/r	S/r
S rS rS rS rS rS rSrg)PyPIRCCommand   z6Base command that knows how to handle the .pypirc filezhttps://upload.pypi.org/legacy/pypiNzrepository=rzurl of repository [default: ])show-responseNz&display full response text from serverr   c                 |    [         R                  R                  [         R                  R                  S5      S5      $ )zReturns rc file path.~z.pypirc)ospathjoin
expanduserselfs    l/home/dmtnaga/Documents/work/airagagent/rag_env/lib/python3.13/site-packages/setuptools/_distutils/config.py_get_rc_filePyPIRCCommand._get_rc_file'   s&    ww||BGG..s3Y??    c                 $   U R                  5       n[        R                  " U[        R                  [        R                  -  S5      n[        R
                  " USSS9 nUR                  [        X4-  5        SSS5        g! , (       d  f       g= f)zCreates a default .pypirc file.i  wutf-8encodingN)r   r   openO_CREATO_WRONLYfdopenwriteDEFAULT_PYPIRC)r   usernamepasswordrcrawfs         r   _store_pypircPyPIRCCommand._store_pypirc+   sa     ggb"**r{{2E:YYsC'2aGGNh%99: 322s   B
Bc                 h   U R                  5       n[        R                  R                  U5      (       Ga  U R	                  SU 35        U R
                  =(       d    U R                  n[        5       nUR                  USS9  UR                  5       nSU;   Ga#  UR                  SS5      nUR                  S5       Vs/ s H)  nUR                  5       S:w  d  M  UR                  5       PM+     nnU/ :X  a  SU;   a  S/nO0 $ U H  nS	U0nUR                  US
5      US
'   SU R                  4SU R                  4S4 H4  u  pUR                  Xi5      (       a  UR                  Xi5      X'   M0  XU	'   M6     US:X  a%  UU R                  S4;   a  U R                  US'   Us  $ US	   U:X  d  US   U:X  d  M  Us  $    0 $ SU;   aj  SnUR                  US5      (       a  UR                  US5      nOU R                  nUR                  US
5      UR                  US5      UUU R                  S.$ 0 $ s  snf )zReads the .pypirc file.zUsing PyPI login from r   r   	distutilszindex-servers
 r	   serverr$   
repositoryrealm)r%   Nzserver-loginr%   )r$   r%   r0   r/   r1   )r   r   r   existsannouncer0   DEFAULT_REPOSITORYr   readsectionsgetsplitstripDEFAULT_REALM
has_option)r   r&   r0   configr6   index_serversr/   _serverscurrentkeydefaults              r   _read_pypircPyPIRCCommand._read_pypirc2   sL    77>>"MM22$78CD,C,CJ$&FKKWK-(Hh& &

; H #0"5"5d";";||~+ #FLLN";  
 r>)$*8  "	&F'0G*0**VZ*HGJ' &t'>'>? $"4"45*)
 ",,V99+1::f+BGL+2CL) 'J//; - 150G0G-&  )Z7"<0J>&; 'Z 	  8+'$$V\::!'FL!AJ!%!8!8J &

6: > &

6: >",$!//  	us   ?H/H/c                 v    UR                  SS5      nUR                  5       R                  [        U5      5      $ )z%Read and decode a PyPI HTTP response.content-typez
text/plain)	getheaderr5   decode_extract_encoding)r   responsecontent_types      r   _read_pypi_response!PyPIRCCommand._read_pypi_response{   s1    )).,G}}%%&7&EFFr   c                 .    SU l         SU l        SU l        g)zInitialize options.NF)r0   r1   show_responser   s    r   initialize_options PyPIRCCommand.initialize_options   s    
"r   c                 ~    U R                   c  U R                  U l         U R                  c  U R                  U l        gg)zFinalizes options.N)r0   r4   r1   r:   r   s    r   finalize_optionsPyPIRCCommand.finalize_options   s5    ??""55DO::++DJ r   )r1   r0   rN   )__name__
__module____qualname____firstlineno____doc__r4   r:   r0   r1   user_optionsboolean_optionsr   r)   rB   rK   rO   rR   __static_attributes__ r   r   r   r      sh    @:MJE 
;<N;OqQRIL
 ''O@;GRG
#,r   r   c                     [         R                  R                  5       nXS'   US   R                  R	                  SS5      $ )zg
>>> _extract_encoding('text/plain')
'ascii'
>>> _extract_encoding('text/html; charset="utf8"')
'utf8'
rE   charsetascii)emailmessageEmailMessageparamsr7   )rJ   msgs     r   rH   rH      s<     --
$
$
&C&~%%)))W==r   )rX   email.messager`   r   configparserr   cmdr   r#   r   rH   r\   r   r   <module>rh      s3     	 ( s,G s,l	>r   