eaiovnaovbqoebvqoeavibavo  abc@@s,ddlmZddlZddlZddlZyddlmZWn!ek rkddlmZnXddl m Z ddl m Z ddl mZddlmZdd lmZmZdd lmZdd lmZmZejeZd e fd YZdZdZdZdS(i(tabsolute_importN(t zip_longest(t izip_longest(tsix(tCommand(t CommandError(t PackageFinder(tget_installed_distributionstdist_is_editable(tRemovedInPip10Warning(tmake_option_groupt index_groupt ListCommandcB@seZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZRS(st List installed packages, including editables. Packages are listed in a case-insensitive sorted order. tlists %prog [options]sList installed packages.c O@sqtt|j|||j}|jdddddtdd|jdd dddtdd |jd d dddtdd |jdddddtdd|jjddddddtdd|jddddtdd|jddddddd$dd|jd dddd!dd"tt|j}|jj d#||jj d#|dS(%Ns-os --outdatedtactiont store_truetdefaultthelpsList outdated packagess-us --uptodatesList uptodate packagess-es --editablesList editable projects.s-ls--localsSIf in a virtualenv that has global access, do not list globally-installed packages.s--usertdesttusers,Only output packages installed in user-site.s--presYInclude pre-release and development versions. By default, pip only finds stable versions.s--formattstoret list_formattchoicestlegacytcolumnstfreezetjsonsJSelect the output format among: legacy (default), columns, freeze or json.s--not-requiredt not_requireds>List packages that are not dependencies of installed packages.i(RRRR( tsuperR t__init__tcmd_optst add_optiontFalseR R tparsertinsert_option_group(tselftargstkwRt index_opts((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyR#s^      c C@s7td|jd|d|jd|jd|jd|S(sK Create a package finder appropriate to this list command. t find_linkst index_urlstallow_all_prereleasest trusted_hoststprocess_dependency_linkstsession(RR'tpreR*R+(R#toptionsR(R,((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyt_build_package_findercs    cC@s)|jrtjdtn|jr8tjdtn|jrTtjdtn|jdkrvtjdtn|jr|j rt dnt d|j d|j d|j}|jr|j||}n|j r|j||}n|jr|j||}n|j||dS( Ns--allow-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.s--allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.s--allow-unverified has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.sThe default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.s5Options --outdated and --uptodate cannot be combined.t local_onlyt user_onlyteditables_only(tallow_externaltwarningstwarnR tallow_all_externaltallow_unverifiedRtNonetoutdatedtuptodateRRtlocalRteditablet get_outdatedt get_uptodateRtget_not_requiredtoutput_package_listing(R#R.R$tpackages((s5/usr/lib/python2.7/site-packages/pip/commands/list.pytrunps<              cC@s5g|j||D]}|j|jkr|^qS(N(titer_packages_latest_infostlatest_versiontparsed_version(R#RAR.tdist((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyR=scC@s5g|j||D]}|j|jkr|^qS(N(RCRDRE(R#RAR.RF((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyR>sc@sQtx+|D]#}jd|jDqWtfd|DS(Ncs@s|]}|jVqdS(N(tkey(t.0t requirement((s5/usr/lib/python2.7/site-packages/pip/commands/list.pys sc3@s$|]}|jkr|VqdS(N(RG(RHtpkg(tdep_keys(s5/usr/lib/python2.7/site-packages/pip/commands/list.pys s(tsettupdatetrequires(R#RAR.RF((RKs5/usr/lib/python2.7/site-packages/pip/commands/list.pyR?s  !c c@sq|jg|j}|jr>tjddj|g}ng}x6|D].}|jdrK|j|jdqKqKW|j |}|j |||}|j |x|D]}d}|j |j } |jsg| D]} | jjs| ^q} n| sqnt| d|j} | j} | jjrFd}nd}| |_||_|VqWWdQXdS(NsIgnoring indexes: %st,sdependency_links.txttunknownRGtwheeltsdist(t index_urltextra_index_urlstno_indextloggertdebugtjoint has_metadatatextendtget_metadata_linest_build_sessionR/tadd_dependency_linkstfind_all_candidatesRGR-tversiont is_prereleasetmaxt_candidate_sort_keytlocationtis_wheelRDtlatest_filetype( R#RAR.R(tdependency_linksRFR,tfinderttyptall_candidatest candidatetbest_candidatetremote_version((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyRCs:              cC@s>t|r&d|j|j|jfSd|j|jfSdS(Ns %s (%s, %s)s%s (%s)(Rt project_nameR_Rc(R#RF((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyt output_legacys   cC@s d|j||j|jfS(Ns%s - Latest: %s [%s](RnRDRe(R#RF((s5/usr/lib/python2.7/site-packages/pip/commands/list.pytoutput_legacy_latests cC@st|dd}|jdkrR|rRt||\}}|j||n|jdkrx|D]}tjd|j|jqhWnq|jdkrtjt||nIxF|D]>}|j rtj|j |qtj|j |qWdS(NRGcS@s |jjS(N(Rmtlower(RF((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyttRRs%s==%sR( tsortedRtformat_for_columnstoutput_package_listing_columnsRVtinfoRmR_tformat_for_jsonR9RoRn(R#RAR.tdatatheaderRF((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyR@s     cC@st|dkr%|jd|nt|\}}t|dkrq|jddjtd|nx|D]}tj|qxWdS(Niit cS@sd|S(Nt-((tx((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyRq Rr(tlentinsertttabulateRXtmapRVRv(R#RxRyt pkg_stringstsizestval((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyRus( (t__name__t __module__t__doc__tnametusagetsummaryRR/RBR=R>R?RCRnRoR@Ru(((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyR s @ 6    '  cC@sdgtd|D}xK|D]C}gt||D]'\}}t|tt|^q:}q$Wg}xm|D]e}djgt||D]3\}}|dk rt|j|nd^q}|j|qxW||fS(Nics@s|]}t|VqdS(N(R}(RHR|((s5/usr/lib/python2.7/site-packages/pip/commands/list.pys sRzRr(RaRR}tstrRXR8tljusttappend(tvalsRtrowtstctresulttdisplay((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyRs A  IcC@s|j}|r$ddddg}n ddg}g}td|Dr\|jdnxu|D]m}|j|jg}|r|j|j|j|jnt|r|j|jn|j|qcW||fS(s_ Convert the package data into something usable by output_package_listing_columns. tPackagetVersiontLatesttTypecs@s|]}t|VqdS(N(R(RHR|((s5/usr/lib/python2.7/site-packages/pip/commands/list.pys 2stLocation( R9tanyRRmR_RDReRRc(tpkgsR.trunning_outdatedRyRxtprojR((s5/usr/lib/python2.7/site-packages/pip/commands/list.pyRt%s     cC@sg}xm|D]e}i|jd6tj|jd6}|jretj|j|d<|j|ds&      !