grthtrhthjhtyjytjytkergtrhtrjytjerhrfh3 ÝPfž.ã@sÎddlmZddlZddlZddlZddlZddlZddlZddlZddl m Z ej de d�y ddl Z Wne k r~YnNXejdkrÌee ddƒdkrÌydd lmZWne efk rÂYn Xejƒdd lmZmZmZdd lmZmZdd lmZmZdd lmZmZm Z m!Z!ddl"m#Z#m$Z$ddl%m&Z&m'Z'ddl%m(Z(ddl m)Z)ddl*Z+e+j,Z,dZ-ej.e/ƒZ0ej de)d�dd„Z1dd„Z2dd„Z3dd„Z4d dd„Z5Gdd„de6ƒZ7e/dk�rÊej8e5ƒƒdS)!é)Úabsolute_importN)ÚDependencyWarningÚignore)ÚcategoryÚdarwinZOPENSSL_VERSION_NUMBERi)Úsecuretransport)ÚInstallationErrorÚ CommandErrorÚPipError)Úget_installed_distributionsÚget_prog)Ú deprecationÚdist_is_editable)ÚgitÚ mercurialÚ subversionÚbazaar)ÚConfigOptionParserÚUpdatingDefaultsHelpFormatter)Ú get_summariesÚget_similar_commands)Ú commands_dict)ÚInsecureRequestWarningz9.0.3c sZdtjkrdStjdjƒdd…}ttjdƒ}y||d‰Wntk rZd‰YnXdd„tƒDƒ‰g}y‡fd d„|Dƒd }Wntk r¢d}YnXtƒ}|�rÜ|d krÂtjdƒ|d koÔˆj d ƒ �rJg}ˆj ƒ}xUsz autocomplete..csg|]}|ˆkr|‘qSrr)rÚw)Ú subcommandsrrrYsrÚhelpZ uninstallú-T)Z local_onlycSs&g|]}|jtjkr|jƒ|jf‘qSr)r"ÚoptparseÚ SUPPRESS_HELPÚget_opt_stringÚnargs)rÚoptrrrrqscSsg|]}|jdƒd‘qS)ú=r)Úsplit)rÚxrrrrvscs g|]\}}|ˆkr||f‘qSrr)rr+Úv)Ú prev_optsrrrwscs"g|]\}}|jˆƒr||f‘qSr)Ú startswith)rÚkr,)Úcurrentrrrysr)z--cSsg|] }|j‘qSr)Ú option_list)rÚirrrrƒscss|]}|D] }|Vq qdS)Nr)rÚitÚorrrú …szautocomplete..cSs g|]}|jtjkr|jƒ‘qSr)r"r$r%r&)rr2rrrr‡sú csg|]}|jˆƒr|‘qSr)r.)rr+)r0rrrŠs)ÚosÚenvironr*ÚintÚ IndexErrorrÚcreate_main_parserÚsysÚexitr.Úlowerr ÚkeyÚappendÚprintrÚparserZoption_list_allZ option_groupsr1Újoin) ZcwordsZcwordZoptionsZsubcommand_namerBZ installedZlcÚdistZ subcommandZoptionZ opt_labelZoptsr)r0r-r!rÚ autocompleteEs\          rEcCs¤ddtƒdtƒdœ}tf|Ž}|jƒtjjtjjtjjtƒƒƒ}dt |t j dd…f|_ t j t j|ƒ}|j|ƒd|_tƒ}dgd d „|Dƒ}d j|ƒ|_|S) Nz %prog [options]FÚglobal)ZusageZadd_help_optionZ formatterÚnameÚprogzpip %s from %s (python %s)éTrcSsg|]\}}d||f‘qS)z%-27s %sr)rr2Újrrrr¦sz&create_main_parser..Ú )rr rZdisable_interspersed_argsr7ÚpathÚdirnameÚabspathÚ__file__Ú __version__r<ÚversionÚ cmdoptionsZmake_option_groupZ general_groupZadd_option_groupÚmainrrCÚ description)Z parser_kwrBZ pip_pkg_dirZgen_optsZcommand_summariesrTrrrr;Žs"    r;cCsÌtƒ}|j|ƒ\}}|jr>tjj|jƒtjjtjƒtjƒ| s\|ddkrlt |ƒdkrl|j ƒtjƒ|d}|t kr®t |ƒ}d|g}|r |j d|ƒtdj|ƒƒ‚|dd…}|j|ƒ||fS)Nrr"rzunknown command "%s"zmaybe you meant "%s"z - )r;Ú parse_argsrQr<ÚstdoutÚwriter7Úlinesepr=ÚlenZ print_helprrr@r rCÚremove)ÚargsrBZgeneral_optionsZ args_elseÚcmd_nameZguessÚmsgÚcmd_argsrrrÚ parseopts¬s&    r_cCsd}d|krd}|S)NFz --isolatedTr)r[ÚisolatedrrrÚcheck_isolatedÖsracCsà|dkrtjdd…}tjƒtƒyt|ƒ\}}WnJtk r~}z.tjjd|ƒtjjt j ƒtj dƒWYdd}~XnXyt j t jdƒWn0t jk rÂ}ztjd|ƒWYdd}~XnXt|t|ƒd�}|j|ƒS)Nrz ERROR: %srz%Ignoring error %s when setting locale)r`)r<Úargvr Zinstall_warning_loggerrEr_r ÚstderrrWr7rXr=ÚlocaleÚ setlocaleÚLC_ALLÚErrorÚloggerÚdebugrrarS)r[r\r^ÚexcÚeZcommandrrrrSßs rSc@sLeZdZffdd„ZejdƒZejdƒZedd„ƒZ e dd„ƒZ d d „Z d S) ÚFrozenRequirementcCs||_||_||_||_dS)N)rGÚreqÚeditableÚcomments)ÚselfrGrmrnrorrrÚ__init__ÿszFrozenRequirement.__init__z-r(\d+)$z-(20\d\d\d\d\d\d)$cCs€tjjtjj|jƒƒ}g}ddlm}m}t|ƒr®|j |ƒr®d}y|||ƒ}Wn2t k r€} zt j d| ƒd}WYdd} ~ XnX|dkr¬t j d|ƒ|j dƒ|jƒ}d}nÂd}|jƒ}|j} | dd} |jj| ƒ} |jj| ƒ} | sî| �rp|jd ƒ}|�r |ƒj||ƒ}|�s*t j d |ƒ|j d ƒnF|j d |ƒ| �rJ| jdƒ}nd | jdƒ}d}d|||j|ƒf}||j|||ƒS)Nr)ÚvcsÚget_src_requirementTzYError when trying to get requirement for VCS system %s, falling back to uneditable formatz-Could not determine repository location of %sz-## !! Could not determine repository locationFrZsvnz(Warning: cannot find svn location for %szF## FIXME: could not find svn URL in dependency_links for this package:z3# Installing as editable to satisfy requirement %s:z{%s}z %s@%s#egg=%s)r7rLÚnormcaserNÚlocationÚpip.vcsrrrsrZget_backend_namerrhZwarningr@Zas_requirementÚspecsÚ_rev_reÚsearchÚ_date_reZ get_backendZ get_locationÚgroupÚegg_nameZ project_name)ÚclsrDZdependency_linksrurorrrsrnrmrjrwrQZ ver_matchZ date_matchZ svn_backendZ svn_locationZrevrrrÚ from_dists`      zFrozenRequirement.from_distcCs,|jƒ}tjd|ƒ}|r(|d|jƒ…}|S)Nz -py\d\.\d$)r|ÚreryÚstart)rDrGÚmatchrrrr|Is  zFrozenRequirement.egg_namecCs2|j}|jrd|}djt|jƒt|ƒgƒdS)Nz-e %srK)rmrnrCÚlistroÚstr)rprmrrrÚ__str__QszFrozenRequirement.__str__N) Ú__name__Ú __module__Ú __qualname__rqrÚcompilerxrzÚ classmethodr~Ú staticmethodr|r„rrrrrlýs     A rlÚ__main__)N)9Z __future__rrdZloggingr7r$Úwarningsr<rZpip._vendor.urllib3.exceptionsrÚfilterwarningsZsslÚ ImportErrorÚplatformÚgetattrZpip._vendor.urllib3.contribrÚOSErrorZinject_into_urllib3Zpip.exceptionsrr r Z pip.utilsr r r rrvrrrrZpip.baseparserrrZ pip.commandsrrrrZpip.cmdoptionsZpiprRrPZ getLoggerr…rhrEr;r_rarSÚobjectrlr=rrrrÚsR       I* [