관리-도구
편집 파일: show.cpython-33.pyc
� 7�Re� c @ sn d d l Z d d l m Z d d l m Z d d l m Z Gd d � d e � Z d d � Z d d � Z d S( i N( u Command( u logger( u pkg_resourcesc sJ | Ee Z d Z d Z d Z d Z d Z � f d d � Z d d � Z � S( u ShowCommandu6 Show information about one or more installed packages.u showu$ %prog [options] <package> ...u* Show information about installed packages.c s^ t t | � j | | � | j j d d d d d d d d d d �| j j d | j � d S( Nu -fu --filesu destu filesu actionu store_trueu defaultu helpu7 Show the full list of installed files for each package.i F( u superu ShowCommandu __init__u cmd_optsu add_optionu Falseu parseru insert_option_group( u selfu argsu kw( u __class__( u* /tmp/pip-zej_zi-build/pip/commands/show.pyu __init__ s u ShowCommand.__init__c C s= | s t j d � d S| } t | � } t | | j � d S( Nu. ERROR: Please provide a package name or names.( u loggeru warnu search_packages_infou print_resultsu files( u selfu optionsu argsu queryu results( ( u* /tmp/pip-zej_zi-build/pip/commands/show.pyu run s u ShowCommand.run( u __name__u __module__u __qualname__u __doc__u nameu usageu summaryu __init__u run( u __locals__( ( u __class__u* /tmp/pip-zej_zi-build/pip/commands/show.pyu ShowCommand s u ShowCommandc c s� t d d � t j D� � } x� | D]� } | j � } | | k r# | | } i | j d 6| j d 6| j d 6d d � | j � D� d 6} t j j | j | j � d d � } t j j | � r� | | d <n | Vq# q# Wd S( u� 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. c S s% g | ] } | j j � | f � q S( ( u project_nameu lower( u .0u p( ( u* /tmp/pip-zej_zi-build/pip/commands/show.pyu <listcomp>, s u( search_packages_info.<locals>.<listcomp>u nameu versionu locationc S s g | ] } | j � q S( ( u project_name( u .0u dep( ( u* /tmp/pip-zej_zi-build/pip/commands/show.pyu <listcomp>5 s u requiresu .egg-infou installed-files.txtu filesN( u dictu pkg_resourcesu working_setu loweru project_nameu versionu locationu requiresu osu pathu joinu egg_nameu isfile( u queryu installed_packagesu nameu normalized_nameu distu packageu filelist( ( u* /tmp/pip-zej_zi-build/pip/commands/show.pyu search_packages_info$ s$ u search_packages_infoc C s� x� | D]� } t j d � t j d | d � t j d | d � t j d | d � t j d d j | d � � | r t j d � d | k r� x? t | d � D] } t j d | j � � q� Wq� t j d � q q Wd S( uD Print the informations from installed distributions found. u ---u Name: %su nameu Version: %su versionu Location: %su locationu Requires: %su , u requiresu Files:u filesu %su! Cannot locate installed-files.txtN( u loggeru notifyu joinu openu strip( u distributionsu list_all_filesu distu line( ( u* /tmp/pip-zej_zi-build/pip/commands/show.pyu print_results@ s u print_results( u osu pip.basecommandu Commandu pip.logu loggeru pip._vendoru pkg_resourcesu ShowCommandu search_packages_infou print_results( ( ( u* /tmp/pip-zej_zi-build/pip/commands/show.pyu <module> s