Ñò
•èRc        *   @   s¯  d  Z  d d k Z d d k Z d d k Z d d k Z d d k Z d d k l Z d d k l	 Z	 l
 Z
 d d k l Z l Z d d k l Z l Z d e i f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d e i f d „  ƒ  YZ d e f d „  ƒ  YZ y0 e i d ƒ Z d e e i e i d  f Z Wn e i j
 o d Z n Xd „  Z e i d d d d d d d d ƒe i d d d d d d d e d e i  ƒe i d d d d  d d! d d" d d# ƒe i d$ d% d d& d d d d' ƒe i d( d) d d* d d! d d" d d+ ƒe i d, d d- d. d/ d d0 ƒe i d1 d d2 d d d e d e i  ƒe i d3 d4 d d5 d. d/ d e d e i  ƒe i d6 d d7 d d d e d e i  ƒe i d8 d d9 d: d; d d< d d= ƒe i d> d? d. d@ d dA d: dB d dC d dD ƒe i dE d dF d: d; d d< d e i  ƒe i dG d dH d: d; d d< d e i  ƒe i dI d dJ d: dK dL dM dN dO dP g d g  d dQ d. d d dR ƒe i dS d dT d: d; d d< d. dU d dV ƒg Z! d S(W   s   Base option parser setupiÿÿÿÿN(   t	   strtobool(   t   ConfigParsert   string_types(   t   default_config_filet   default_log_file(   t   get_terminal_sizet   get_progt   PrettyHelpFormatterc           B   s\   e  Z d  Z d „  Z d „  Z d d d „ Z d „  Z d „  Z d „  Z d	 „  Z	 d
 „  Z
 RS(   s4   A prettier/less verbose help formatter for optparse.c         O   sC   d | d <d | d <t  ƒ  d d | d <t i i |  | | Ž d  S(   Ni   t   max_help_positioni   t   indent_incrementi    i   t   width(   R   t   optparset   IndentedHelpFormattert   __init__(   t   selft   argst   kwargs(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyR      s    

c         C   s   |  i  | d d ƒ S(   Ns    <%s>s   , (   t   _format_option_strings(   R   t   option(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   format_option_strings   s    s    <%s>s   , c         C   s¿   g  } | i  o | i | i  d ƒ n | i o | i | i d ƒ n t | ƒ d j o | i d | ƒ n | i ƒ  o4 | i p | i i ƒ  } | i | | i ƒ  ƒ n d i	 | ƒ S(   s  
        Return a comma-separated list of option strings and metavars.

        :param option:  tuple of (short opt, long opt), e.g: ('-f', '--format')
        :param mvarfmt: metavar format string - evaluated as mvarfmt % metavar
        :param optsep:  separator
        i    i   t    (
   t   _short_optst   appendt
   _long_optst   lent   insertt   takes_valuet   metavart   destt   lowert   join(   R   R   t   mvarfmtt   optsept   optsR   (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyR      s    

c         C   s   | d j o d S| d S(   Nt   OptionsR   s   :
(    (   R   t   heading(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   format_heading2   s    c         C   s#   d |  i  t i | ƒ d ƒ } | S(   sz   
        Ensure there is only one newline between usage and the first heading
        if there is no description.
        s   
Usage: %s
s     (   t   indent_linest   textwrapt   dedent(   R   t   usaget   msg(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   format_usage7   s    c         C   s}   | on t  |  i d ƒ o
 d } n d } | i d ƒ } | i ƒ  } |  i t i | ƒ d ƒ } d | | f } | Sd Sd  S(   Nt   maint   Commandst   Descriptions   
s     s   %s:
%s
R   (   t   hasattrt   parsert   lstript   rstripR%   R&   R'   (   R   t   descriptiont   label(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   format_description?   s    
c         C   s   | o | Sd Sd  S(   NR   (    (   R   t   epilog(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   format_epilogQ   s    c         C   s;   g  } | i  d ƒ D] } | | | q ~ } d i | ƒ S(   Ns   
(   t   splitR   (   R   t   textt   indentt   _[1]t   linet	   new_lines(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyR%   X   s    .(   t   __name__t
   __module__t   __doc__R   R   R   R$   R*   R4   R6   R%   (    (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyR      s   						t   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=   |  i  d  j	 o |  i  i |  i  i ƒ n t i i |  | ƒ S(   N(   R/   t   Nonet   update_defaultst   defaultsR   R   t   expand_default(   R   R   (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyRD   b   s    (   R=   R>   R?   RD   (    (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyR@   ]   s   t   CustomOptionParserc           B   s    e  Z d  „  Z e d „  ƒ Z RS(   c         O   s6   |  i  | | Ž  } |  i i ƒ  |  i i | | ƒ | S(   s*   Insert an OptionGroup at a given position.(   t   add_option_groupt   option_groupst   popR   (   R   t   idxR   R   t   group(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   insert_option_groupi   s    c         C   s2   |  i  } x! |  i D] } | i | i  ƒ q W| S(   s<   Get a list of all options, including those in option groups.(   t   option_listRG   t   extend(   R   t   rest   i(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   option_list_allr   s
    

 (   R=   R>   RK   t   propertyRP   (    (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyRE   h   s   		t   ConfigOptionParserc           B   sY   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d „ Z d „  Z	 d	 „  Z
 RS(
   sv   Custom option parser which updates its defaults by by checking the
    configuration files and environmental variablesc         O   sn   t  i ƒ  |  _ | i d ƒ |  _ |  i ƒ  |  _ |  i i |  i ƒ |  i p t ‚ t	 i
 i |  | | Ž d  S(   Nt   name(   R   t   RawConfigParsert   configRH   RS   t   get_config_filest   filest   readt   AssertionErrorR   t   OptionParserR   (   R   R   R   (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyR   €   s    c         C   s>   t  i i d t ƒ } | o t  i i | ƒ o | g St g S(   Nt   PIP_CONFIG_FILE(   t   ost   environt   gett   Falset   patht   existsR   (   R   t   config_file(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyRV   ˆ   s    c      	   C   sU  h  } x6 d |  i  f D]% } | i |  i |  i | ƒ ƒ ƒ q W| i |  i |  i ƒ  ƒ ƒ xó | i ƒ  D]å \ } } |  i | ƒ } | d	 j	 o½ | p qh n | i d j o | i	 ƒ  } n
 d | _
 | i d
 j o t | ƒ } n y | i | | ƒ } Wn< t i j
 o- t i ƒ  d } d | GHt i d ƒ n X| | | i <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   globalR   i   t
   store_truet   store_falset   counts*   An error occurred during configuration: %si   N(   Rd   Re   s   count(   RS   t   updatet   normalize_keyst   get_config_sectiont   get_environ_varst   itemst
   get_optionRA   t   actionR7   t   nargsR    t   convert_valueR   t   OptionValueErrort   syst   exc_infot   exitR   (   R   RC   RU   t   sectiont   keyt   valR   t   e(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyRB   Ž   s0     # 		c         C   s[   h  } xN | D]F \ } } | i  d d ƒ } | i d ƒ p 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   Rk   t
   normalizedRu   Rv   (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyRh   °   s     c         C   s(   |  i  i | ƒ o |  i  i | ƒ Sg  S(   s    Get a section of a configuration(   RU   t   has_sectionRk   (   R   RS   (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyRi   ¼   s    t   PIP_c         c   sU   xN t  i i ƒ  D]= \ } } | i | ƒ o! | i | d ƒ i ƒ  | f Vq q Wd S(   s@   Returns a generator with all environmental vars with prefix PIP_R   N(   R\   R]   Rk   R{   Rz   R   (   R   t   prefixRu   Rv   (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyRj   Â   s     c         C   s¢   |  i  p t i |  i ƒ S|  i |  i i ƒ  ƒ } x_ |  i ƒ  D]Q } | i | i ƒ } t	 | t
 ƒ o) | i ƒ  } | i | | ƒ | | i <q@ q@ Wt i | ƒ 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   ValuesRC   RB   t   copyt   _get_all_optionsR^   R   t
   isinstanceR   t   get_opt_stringt   check_value(   R   RC   R   t   defaultt   opt_str(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   get_default_valuesÈ   s    
 !c         C   s(   |  i  t i ƒ |  i d d | ƒ d  S(   Ni   s   %s
(   t   print_usageRq   t   stderrRs   (   R   R)   (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   error×   s    (   R=   R>   R?   R   RV   RB   Rh   Ri   Rj   R‰   RŒ   (    (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyRR   |   s   			"			t   pips   %s from %s (python %s)i   c          C   s   h d d 6t  d 6t ƒ  d 6d d 6t ƒ  d 6}  t |    } t i | d ƒ } | i ƒ  t | _ x t D] } | i	 | ƒ qg W| i
 | ƒ | S(	   Ns   
%prog <command> [options]R(   t   add_help_optiont	   formatterRc   RS   t   progs   General Options(   R_   R@   R   RR   R   t   OptionGroupt   disable_interspersed_argst   versiont   standard_optionst
   add_optionRF   (   t	   parser_kwR/   t   genoptt   opt(    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   create_main_parserå   s    

	 s   -hs   --helpR   t   helpRm   s
   Show help.s   --require-virtualenvs   --require-venvt   require_venvRd   R‡   s   -vs	   --verboset   verboseRf   i    sD   Give more output. Option is additive, and can be used up to 3 times.s   -Vs	   --versionR“   s   Show version and exit.s   -qs   --quiett   quiets   Give less output.s   --logt   logR   t   filesB   Log file where a complete (maximum verbosity) record will be kept.s   --log-explicit-levelst   log_explicit_levelss   --local-logs
   --log-filet   log_files
   --no-inputt   no_inputs   --proxyt   proxyt   typet   strR   s<   Specify a proxy in the form [user:passwd@]proxy.server:port.s	   --timeouts   --default-timeoutt   sect   timeoutt   floati   s2   Set the socket timeout (default %default seconds).s   --default-vcst   default_vcss   --skip-requirements-regext   skip_requirements_regexs   --exists-actiont   exists_actiont   choicet   choicest   sRO   t   wt   bR   sP   Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.s   --certt   certR`   s   Path to alternate CA bundle.("   R?   Rq   R   t   pkg_resourcesR\   R&   t   distutils.utilR    t   pip.backwardcompatR   R   t   pip.locationsR   R   t   pip.utilR   R   R   R   R@   RZ   RE   RR   t   get_distributiont   pip_distt   locationR“   t   DistributionNotFoundRA   R™   t   make_optionR_   t   SUPPRESS_HELPR”   (    (    (    sJ   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/baseparser.pyt   <module>   sà   O`														