abc@@sdZddlmZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z ddlmZddlmZmZmZmZmZdd lmZdd lmZmZdd lmZmZdd lmZm Z m!Z!m"Z"m#Z#dd l$m%Z%m&Z&m'Z'ddl(m)Z)ddl*m+Z+dgZ,ej-e.Z/de0fdYZ1de1fdYZ2dS(s(Base Command class, and related routinesi(tabsolute_importN(t cmdoptions(t PackageFinder(trunning_under_virtualenv(t PipSession(t BadCommandtInstallationErrortUninstallationErrort CommandErrortPreviousBuildDirError(tlogging_dictConfig(tConfigOptionParsertUpdatingDefaultsHelpFormatter(tInstallRequirementtparse_requirements(tSUCCESStERRORt UNKNOWN_ERRORtVIRTUALENV_NOT_FOUNDtPREVIOUS_BUILD_DIR_ERROR(t deprecationtget_progtnormalize_path(tIndentingFormatter(tpip_version_checktCommandcB@sMeZdZdZeZdZedZdddZ dZ dZ RS(sext://sys.stdoutsext://sys.stderrcC@si|jd6dt|jfd6td6td6|jd6|jd6|d6}t||_d |jj}t j |j||_ t j t j|j}|jj|dS( Ntusages%s %stprogt formattertadd_help_optiontnamet descriptiontisolateds %s Options(RRRR tFalset__doc__R tparsert capitalizetoptparset OptionGrouptcmd_optsRtmake_option_groupt general_grouptadd_option_group(tselfR t parser_kwt optgroup_nametgen_opts((s3/usr/lib/python2.7/site-packages/pip/basecommand.pyt__init__)s      cC@std|jr-ttjj|jdndd|dk rE|n|jd|j}|j rr|j |_ n|j r|j |_ n|j s|r|dk r|n|j |_ n|j ri|j d6|j d6|_n|j |j_|S(Ntcachethttptretriestinsecure_hoststhttps(Rt cache_dirRtostpathtjointNoneR2t trusted_hoststcerttverifyt client_certttimeouttproxytproxiestno_inputtautht prompting(R+toptionsR2R>tsession((s3/usr/lib/python2.7/site-packages/pip/basecommand.pyt_build_sessionAs -   !  cC@s|jj|S(N(R#t parse_args(R+targs((s3/usr/lib/python2.7/site-packages/pip/basecommand.pyRGesc @s|j|\}}|jrW|jdkr6dn|jdkrNdqodn|jridnd}|jrd}ntidd6td 6iid d 6tjd 6d 6d6iitd 6dd6d6d6iid 6dd6|j dd6d gd6dd6d6idd 6dd6|j dd6dd6d6idd 6dd6|jpTdd6t d6dd6d6d6i|d 6t t ddd|jrdndgd6d 6tfd!d"d#d$d%gDd&6tjd d7krtjd(tjn|jrd)tjd*d+j|jtjd,s s pip._vendortdistlibtrequeststurllib3tloggersisPython 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6t1t PIP_NO_INPUTt tPIP_EXISTS_ACTIONs2Could not find an activated virtualenv (required).sException information:texc_infos ERROR: %ssOperation cancelled by users Exception:tno_indexR2R>i(ii(5RGtquiettverbosetlogR R!tloggingRIRt log_streamstTruetlisttfilterR9tdicttsyst version_infotwarningstwarnRtPython26DeprecationWarningRAR6tenviront exists_actionR8t require_venvRtloggertcriticaltexitRtrunt isinstancetintR tstrtdebugRRRRRRtKeyboardInterruptRtdisable_pip_version_checktgetattrRFtminR>RR(R+RHRDt root_leveltstatustexcRE((ROs3/usr/lib/python2.7/site-packages/pip/basecommand.pytmainis            #          N(sext://sys.stdoutsext://sys.stderr( t__name__t __module__R9RRR!thiddenRmR/RFRGR(((s3/usr/lib/python2.7/site-packages/pip/basecommand.pyR#s $ tRequirementCommandcB@s,eZedZdddddZRS(c C@sxS|jD]H}x?t|dtd|d|d|d|D]}|j|q;Wq Wx6|D].}|jtj|d d|jd|q]Wx?|jD]4}|jtj |d|j d|jd|qWt } xS|j D]H}x?t|d|d|d|d|D]}t} |j|q WqW|j |_ |pK|jpK| si|d6} |jrd t| d d j|j} n d | } tj| nd S(s? Marshal cmd line args into a requirement set. t constrainttfinderRDREt wheel_cacheR t default_vcsRs^You must give at least one requirement to %(name)s (maybe you meant "pip %(name)s %(links)s"?)tlinksResLYou must give at least one requirement to %(name)s (see "pip help %(name)s")N(t constraintsRRntadd_requirementR t from_lineR9t isolated_modet editablest from_editableRR!t requirementstrequire_hashest find_linksRqR8Rztwarning( trequirement_setRHRDRRERRRYtreqtfound_req_in_filetoptstmsg((s3/usr/lib/python2.7/site-packages/pip/basecommand.pytpopulate_requirement_setsF       "cC@s|jg|j}|jr>tjddj|g}ntd|jd|jd|d|j d|j d|j d |d |d |d |d | S(sR Create a package finder appropriate to this requirement command. sIgnoring indexes: %st,Rtformat_controlt index_urlsR:tallow_all_prereleasestprocess_dependency_linksREtplatformtversionstabitimplementation( t index_urltextra_index_urlsRhRzRR8RRRR:tpreR(R+RDRERtpython_versionsRRR((s3/usr/lib/python2.7/site-packages/pip/basecommand.pyt_build_package_finder:s        N(RRt staticmethodRR9R(((s3/usr/lib/python2.7/site-packages/pip/basecommand.pyRs8(3R"t __future__RRlR6RrR%RttpipRt pip.indexRt pip.locationsRt pip.downloadRtpip.exceptionsRRRRR t pip.compatR tpip.baseparserR R tpip.reqR Rtpip.status_codesRRRRRt pip.utilsRRRtpip.utils.loggingRtpip.utils.outdatedRt__all__t getLoggerRRztobjectRR(((s3/usr/lib/python2.7/site-packages/pip/basecommand.pyts,     ((