\dWRdZddlZddlmZddlZddlmZdZGddeZdS)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`eZdZdZdZdZdZdZdddezfdgZd gZ d Z d Z d Z d Z dZdZdS) PyPIRCCommandz;Base command that knows how to handle the .pypirc file zhttps://upload.pypi.org/legacy/pypiNz repository=rzurl of repository [default: %s]) show-responseNz&display full response text from serverr c|tjtjddS)zReturns rc file path.~z.pypirc)ospathjoin expanduserselfs !..\python\lib\distutils\config.py _get_rc_filezPyPIRCCommand._get_rc_file's(w||BG..s33Y???c|}tjtj|tjtjzdd5}|t||fzddddS#1swxYwYdS)zCreates a default .pypirc file.iwN)rr fdopenopenO_CREATO_WRONLYwriteDEFAULT_PYPIRC)rusernamepasswordrcfs r _store_pypirczPyPIRCCommand._store_pypirc+s     Yrwr2: #;UCCS I I ;Q GGNh%99 : : : ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;s BB Bc|}tj|r|d|z|jp|j}t}||| }d|vr| dd}d| dD}|gkr d|vrdg}niS|D]}d|i}| |d|d<d |jfd |j fd fD]:\} } | || r| || || <5| || <;|dkr||jdfvr|j|d <|cS|d|ks |d |kr|cSnod |vrkd }| |d r| |d }n|j}| |d| |d |||j dSiS)zReads the .pypirc file.zUsing PyPI login from %s distutilsz index-serverscfg|].}|dk|/S))strip).0servers r z.PyPIRCCommand._read_pypirc..>s<555v%||~~33#LLNN333r rr(r repositoryrealm)rNz server-loginr)rrr+r(r,)rr r existsannouncer+DEFAULT_REPOSITORYrreadsectionsgetsplit DEFAULT_REALM has_option) rrr+configr1 index_servers_serversr(currentkeydefaults r _read_pypirczPyPIRCCommand._read_pypirc1s     7>>"  9 5 MM4r9 : : :CD,CJ$&&F KKOOO((Hh&& & ; H H 55)//55555r>>))$*8 " &''F'0G*0**VZ*H*HGJ'+7*.*A*C*143E)F);)=33 W",,VS993+1::fc+B+BGCLL+2GCLL &(("t'>&GGG040G -&)Z77 -;;& ? ? ? JJJ                )).,GG ##L11!488GLL}}%%h///s?AAc0d|_d|_d|_dS)zInitialize options.Nr)r+r, show_responsers rinitialize_optionsz PyPIRCCommand.initialize_optionszs rcV|j |j|_|j|j|_dSdS)zFinalizes options.N)r+r/r,r4rs rfinalize_optionszPyPIRCCommand.finalize_optionss2 ? ""5DO : +DJJJ  r)__name__ __module__ __qualname____doc__r/r4r+r, user_optionsboolean_optionsrr!r<rMrPrRrrrrs:MJ E  *    3 4L''O@@@;;; >>>@000 ,,,,,rr) rVr configparserrrB distutils.cmdrrrrYrrr\s  ((((((!!!!!!o,o,o,o,o,Go,o,o,o,o,r