ó
û_¾Tc           @   s@  d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z m	 Z	 d d l
 m Z m Z d e j f d „  ƒ  YZ d e j f d	 „  ƒ  YZ y0 e j d
 ƒ Z d e e j e j d  f Z Wn e j k
 rð d Z n Xe d d d e d e d e ƒ  d d ƒ Z e j d d d d d d d d ƒe j d d d d d d d e d e j ƒe j d d  d d! d d" d d# d d$ ƒe j d% d& d d' d d" d d# d d( ƒe j d) d d* d+ d, d d- ƒe j d. d d/ d d d e d e j ƒe j d0 d1 d d2 d+ d, d e d e j ƒe j d3 d d4 d d d e d e j ƒe j d5 d d6 d7 d8 d d9 d d: ƒe j d; d< d+ d= d d> d7 d? d d@ d dA ƒe j dB d dC d7 d8 d d9 d e j ƒe j dD d dE d7 d8 d d9 d e j ƒe j dF d dG d7 dH dI dJ dK dL dM g d g  d dN d dO ƒe j ƒ  d S(P   s   Base option parser setupiÿÿÿÿN(   t	   strtobool(   t   ConfigParsert   string_types(   t   default_config_filet   default_log_filet   UpdatingDefaultsHelpFormatterc           B   s   e  Z d  Z d „  Z RS(   s£   Custom help formatter for use in ConfigOptionParser that updates
    the defaults before expanding them, allowing them to show up correctly
    in the help listingc         C   s;   |  j  d  k	 r( |  j  j |  j  j ƒ n  t j j |  | ƒ S(   N(   t   parsert   Nonet   update_defaultst   defaultst   optparset   IndentedHelpFormattert   expand_default(   t   selft   option(    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyR      s    (   t   __name__t
   __module__t   __doc__R   (    (    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyR      s   t   ConfigOptionParserc           B   sP   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d „ Z d „  Z	 RS(	   sv   Custom option parser which updates its defaults by by checking the
    configuration files and environmental variablesc         O   sl   t  j ƒ  |  _ | j d ƒ |  _ |  j ƒ  |  _ |  j j |  j ƒ |  j sR t ‚ t	 j
 j |  | | Ž d  S(   Nt   name(   R   t   RawConfigParsert   configt   popR   t   get_config_filest   filest   readt   AssertionErrorR
   t   OptionParsert   __init__(   R   t   argst   kwargs(    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyR      s    c         C   s;   t  j j d t ƒ } | r4 t  j j | ƒ r4 | g St g S(   Nt   PIP_CONFIG_FILE(   t   ost   environt   gett   Falset   patht   existsR   (   R   t   config_file(    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyR   #   s    c         C   sK  i  } x6 d |  j  f D]% } | j |  j |  j | ƒ ƒ ƒ q W| j |  j |  j ƒ  ƒ ƒ xé | j ƒ  D]Û \ } } |  j | ƒ } | d	 k	 rh | s› qh n  | j d k r¹ | j	 ƒ  } n	 d | _
 | j d
 k rà t | ƒ } n  y | j | | ƒ } Wn: t j k
 r2t j ƒ  d } d | GHt j d ƒ n X| | | j <qh qh W| S(   s¢   Updates the given defaults with values from the config files and
        the environ. Does a little special handling for certain types of
        options (lists).t   globalt   appendi   t
   store_truet   store_falset   counts)   An error occured during configuration: %si   N(   R)   R*   s   count(   R   t   updatet   normalize_keyst   get_config_sectiont   get_environ_varst   itemst
   get_optionR   t   actiont   splitt   nargsR    t   convert_valueR
   t   OptionValueErrort   syst   exc_infot   exitt   dest(   R   R	   R   t   sectiont   keyt   valR   t   e(    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyR   )   s,    #		c         C   sY   i  } xL | D]D \ } } | j  d d ƒ } | j d ƒ sG d | } n  | | | <q W| S(   s™   Return a config dictionary with normalized keys regardless of
        whether the keys were specified in environment variables or in config
        filest   _t   -s   --s   --%s(   t   replacet
   startswith(   R   R0   t
   normalizedR<   R=   (    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyR-   K   s    c         C   s&   |  j  j | ƒ r" |  j  j | ƒ Sg  S(   s    Get a section of a configuration(   R   t   has_sectionR0   (   R   R   (    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyR.   W   s    t   PIP_c         c   sS   xL t  j j ƒ  D]; \ } } | j | ƒ r | j | d ƒ j ƒ  | f Vq q Wd S(   s@   Returns a generator with all environmental vars with prefix PIP_t    N(   R    R!   R0   RB   RA   t   lower(   R   t   prefixR<   R=   (    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyR/   ]   s    c         C   sž   |  j  s t j |  j ƒ S|  j |  j j ƒ  ƒ } x] |  j ƒ  D]O } | j | j ƒ } t	 | t
 ƒ r> | j ƒ  } | j | | ƒ | | j <q> q> Wt j | ƒ S(   s‹   Overridding to make updating the defaults after instantiation of
        the option parser possible, update_defaults() does the dirty work.(   t   process_default_valuesR
   t   ValuesR	   R   t   copyt   _get_all_optionsR"   R:   t
   isinstanceR   t   get_opt_stringt   check_value(   R   R	   R   t   defaultt   opt_str(    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyt   get_default_valuesc   s    	 (
   R   R   R   R   R   R   R-   R.   R/   RR   (    (    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyR      s   			"		t   pips   %s from %s (python %s)i   t   usages   %prog COMMAND [OPTIONS]t   versiont   add_help_optiont	   formatterR   R'   s   -hs   --helpR:   t   helpR2   R)   s	   Show helps   --require-virtualenvs   --require-venvt   require_venvRP   s   -vs	   --verboset   verboseR+   i    s   Give more outputs   -qs   --quiett   quiets   Give less outputs   --logt   logt   metavart   FILENAMEsA   Log file where a complete (maximum verbosity) record will be kepts   --log-explicit-levelst   log_explicit_levelss   --local-logs
   --log-filet   log_files
   --no-inputt   no_inputs   --proxyt   proxyt   typet   strRF   sð   Specify a proxy in the form user:passwd@proxy.server:port. Note that the user:password@ is optional and required only if you are behind an authenticated proxy.  If you provide user@proxy.server:port then you will be prompted for a password.s	   --timeouts   --default-timeoutt   SECONDSt   timeoutt   floati   s1   Set the socket timeout (default %default seconds)s   --default-vcst   default_vcss   --skip-requirements-regext   skip_requirements_regexs   --exists-actiont   exists_actiont   choicet   choicest   st   it   wt   bR(   sº   Default action when a path already exists.Use this option more then one time to specify another action if a certain option is not available, choices: (s)witch, (i)gnore, (w)ipe, (b)ackup(   R   R7   R
   t   pkg_resourcesR    t   distutils.utilR    t   pip.backwardcompatR   R   t   pip.locationsR   R   R   R   R   R   t   get_distributiont   pip_distt   locationRU   t   DistributionNotFoundR   R#   R   t
   add_optiont   SUPPRESS_HELPt   disable_interspersed_args(    (    (    sf   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/baseparser.pyt   <module>   sÊ   [
				
		
	

	

