ó 9ÕÒTc@@s™ddlmZddlZddlZddlmZddlmZmZddl m Z ej e ƒZ defd„ƒYZd„Zd „ZdS( i(tabsolute_importN(tCommand(tSUCCESStERROR(t pkg_resourcest ShowCommandcB@s2eZdZdZdZdZd„Zd„ZRS(s6Show information about one or more installed packages.tshows$ %prog [options] ...s*Show information about installed packages.c O@s^tt|ƒj||Ž|jjdddddddtdd ƒ|jjd |jƒdS( Ns-fs--filestdesttfilestactiont store_truetdefaultthelps7Show the full list of installed files for each package.i(tsuperRt__init__tcmd_optst add_optiontFalsetparsertinsert_option_group(tselftargstkw((s7/usr/lib/python2.7/vendor-packages/pip/commands/show.pyRs  cC@sC|stjdƒtS|}t|ƒ}t||jƒs?tStS(Ns.ERROR: Please provide a package name or names.(tloggertwarningRtsearch_packages_infot print_resultsRR(RtoptionsRtquerytresults((s7/usr/lib/python2.7/vendor-packages/pip/commands/show.pytrun s  (t__name__t __module__t__doc__tnametusagetsummaryRR(((s7/usr/lib/python2.7/vendor-packages/pip/commands/show.pyRs  c c@stgtjD]}|jjƒ|f^q ƒ}g|D]}|jƒ^q8}xÂg|D]}||krZ||^qZD]—}i|jd6|jd6|jd6g|jƒD]}|j^q®d6}d } t |tj ƒr|j dƒrö|j dƒ} g| D]} | j dƒd^q} g| D]}tjj|j|ƒ^q*} g| D]}tjj||jƒ^qU} qönw|j dƒrö|j dƒ} g| D]}tjj|j|ƒ^q¤} g| D]}tjj||jƒ^qÏ} n| ot| ƒ|d <|VqzWd S( sî Gather details from installed distributions. Print distribution name, version, location, and installed files. Installed files requires a pip generated 'installed-files.txt' in the distributions '.egg-info' directory. R"tversiontlocationtrequirestRECORDt,isinstalled-files.txtRN(tdictRt working_sett project_nametlowerR%R&R'tNonet isinstancetDistInfoDistributiont has_metadatatget_metadata_linestsplittostpathtjointrelpathtegg_infotsorted( Rtpt installedR"t query_namestpkgtdisttdeptpackaget file_listtlinestltpaths((s7/usr/lib/python2.7/vendor-packages/pip/commands/show.pyR,s,.0   &&+1+.cC@sít}xà|D]Ø}t}tjdƒtjd|dƒtjd|dƒtjd|dƒtjdd j|d ƒƒ|r tjd ƒ|d dk rÕx9|d D]}tjd |jƒƒq±Wqåtjdƒq q W|S(sD Print the informations from installed distributions found. s---sName: %sR"s Version: %sR%s Location: %sR&s Requires: %ss, R'sFiles:Rs %ss!Cannot locate installed-files.txtN(RtTrueRtinfoR6R.tstrip(t distributionstlist_all_filestresults_printedR>tline((s7/usr/lib/python2.7/vendor-packages/pip/commands/show.pyRQs   (t __future__RtloggingR4tpip.basecommandRtpip.status_codesRRt pip._vendorRt getLoggerRRRRR(((s7/usr/lib/python2.7/vendor-packages/pip/commands/show.pyts   %