
Rc           @   sn  d  Z  d d k Z d d k Z d d k Z d d k Z d d k l Z l Z y d d k Z Wn e	 j
 o d d k
 Z n Xd d d d d d	 d
 d d d d g Z d   Z e i o e i i e e i   Z n e e i    Z e i d j o6 d e d i   j o e e i i e e   Z n e i d j o9 d e d i   j o" e e i i e e e   Z n e i d j o9 d e d i   j o" e e i i e e e   Z n d   Z e   Z e a d   Z e i   Z e i d  Z d   Z e i i    d Z! e i d  Z" e! d e! d Z# e i i$ e i%  Z& e i i$ e i'  Z( d a* d Z+ d   Z, d   Z- d    Z. d!   Z/ d"   Z0 d#   Z1 d d$  Z2 d%   Z3 d&   Z4 d'   Z5 d d(  Z6 d)   Z7 d*   Z8 d+   Z9 e0   d e: d,  Z; e0   d e: d-  Z< d.   Z= d/   Z> d0   Z? d1   Z@ d2   ZA d3   ZB eC d4 j o eB   n d S(5   s-   Access to Python's configuration information.iN(   t   pardirt   realpatht   get_config_h_filenamet   get_config_vart   get_config_varst   get_makefile_filenamet   get_patht   get_path_namest	   get_pathst   get_platformt   get_python_versiont   get_scheme_namest   parse_config_hc         C   s)   y t  |   SWn t j
 o |  SXd  S(   N(   R   t   OSError(   t   path(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _safe_realpath"   s    t   ntt   pcbuildis   \pc\vis   \pcbuild\amd64ic          C   s?   x8 d D]0 }  t  i i t  i i t d |    o t Sq Wt S(   Ns
   Setup.dists   Setup.localt   Modules(   s
   Setup.dists   Setup.local(   t   osR   t   isfilet   joint   _PROJECT_BASEt   Truet   False(   t   fn(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   is_python_build:   s
     %	c       	   C   s   t  p d d k l }  |  d  } | i d  } | p
 t d  | i   i i   } z | ~ } t i	 |  Wd  QXt
 o; x8 d D], } t i | d d	  t i | d
 d  q Wn t a  n d  S(   Ni(   t   finders   distlib._backports   sysconfig.cfgs   sysconfig.cfg existst   posix_prefixt
   posix_homet   includes   {srcdir}/Includet   platincludes   {projectbase}/.(   R   R   (   t	   _cfg_readt   distlib.resourcesR   t   findt   AssertionErrort	   as_streamt   __exit__t	   __enter__t   _SCHEMESt   readfpt   _PYTHON_BUILDt   setR   (   R   t   _findert   _cfgfilet   _[1]t   st   scheme(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _ensure_cfg_readD   s    # s   \{([^{]*?)\}c            s3  t    |  i d  o |  i d  } n
 t   } |  i   } xf | D]^ } | d j o qF n xA | D]9 \ } } |  i | |  o qg n |  i | | |  qg WqF W|  i d  xw |  i   D]i } t |  i |       f d   } x< |  i |  D]+ \ } } |  i | | t	 i
 | |   q Wq Wd  S(   Nt   globalsc            s2   |  i  d  } |   j o	   | S|  i  d  S(   Ni   i    (   t   group(   t   matchobjt   name(   t	   variables(    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt	   _replacern   s    	(   R0   t   has_sectiont   itemst   tuplet   sectionst
   has_optionR*   t   remove_sectiont   dictt	   _VAR_REPLt   sub(   t   configR1   R:   t   sectiont   optiont   valueR6   (    (   R5   sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _expand_globalsX   s,    	    i    i   i   c            s     f d   } t  i | |   S(   s   In the string `path`, replace tokens like {some.thing} with the
    corresponding value from the map `local_vars`.

    If there is no corresponding value, leave the token unchanged.
    c            sN   |  i  d  } |   j o	   | S| t i j o t i | S|  i  d  S(   Ni   i    (   R2   R   t   environ(   R3   R4   (   t
   local_vars(    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR6      s    	(   R>   R?   (   R   RF   R6   (    (   RF   sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _subst_vars   s    c         C   sK   |  i    } x8 | i   D]* \ } } | | j o q n | |  | <q Wd  S(   N(   t   keysR8   (   t   target_dictt
   other_dictt   target_keyst   keyRC   (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _extend_dict   s     c         C   s   h  } | d  j o
 h  } n t | t    xb t i |   D]Q \ } } t i d j o t i i |  } n t i i	 t
 | |   | | <q= W| S(   Nt   posixR   (   s   posixs   nt(   t   NoneRM   R   R'   R8   R   R4   R   t
   expandusert   normpathRG   (   R/   t   varst   resRL   RC   (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _expand_vars   s    
 #c            s     f d   } t  i | |   S(   Nc            s2   |  i  d  } |   j o	   | S|  i  d  S(   Ni   i    (   R2   (   R3   R4   (   RR   (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR6      s    	(   R>   R?   (   RC   RR   R6   (    (   RR   sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   format_value   s    c           C   s   t  i d j o d St  i S(   NRN   R   (   R   R4   (    (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _get_default_scheme   s    c          C   s   t  i i d d   }  d   } t  i d j o6 t  i i d  p d } |  o |  S| | d  Sn t i d j oE t d  } | o. |  o |  S| d d	 | d
 t i d   Sq n |  o |  S| d d  Sd  S(   Nt   PYTHONUSERBASEc          W   s   t  i i t  i i |     S(   N(   R   R   RP   R   (   t   args(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   joinuser   s    R   t   APPDATAt   ~t   Pythont   darwint   PYTHONFRAMEWORKt   Librarys   %d.%di   s   .local(	   R   RE   t   getRO   R4   t   syst   platformR   t   version_info(   t   env_baseRY   t   baset	   framework(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _getuserbase   s"    	c         C   s9  t  i d  } t  i d  } t  i d  } | d j o
 h  } n h  } h  } t i |  d d d d i i   } z | ~ } | i   }	 Wd QXx |	 D] }
 |
 i d	  p |
 i	   d
 j o q n | i
 |
  } | o | i d d  \ } } | i	   } | i d d
  } d | j o | | | <q|y t |  } Wn) t j
 o | i d d  | | <q|X| | | <q q Wt | i    } d } xLt |  d j o8x1t |  D]#} | | } | i |  p | i |  } | d j	 o| i d  } t } | | j o t | |  } n | | j o
 t } n | t i j o t i | } nz | | j o^ | i d  o | d | j o
 d
 } qd | | j o
 t } qt | d |  } n d
 | | <} | o | | i   } | | i    | | } d | j o | | | <qy t |  } Wn# t j
 o | i	   | | <n X| | | <| i |  | i d  o: | d | j o) | d } | | j o | | | <qqqq| | | <| i |  qWqWx> | i   D]0 \ } } t | t  o | i	   | | <qqW| i |  | S(   s   Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    s"   ([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)s   \$\(([A-Za-z][A-Za-z0-9_]*)\)s   \${([A-Za-z][A-Za-z0-9_]*)}t   encodings   utf-8t   errorst   surrogateescapeNt   #t    i   i   s   $$t   $t   CFLAGSt   LDFLAGSt   CPPFLAGSi    t   PY_i   (   s   CFLAGSs   LDFLAGSs   CPPFLAGS(   t   ret   compileRO   t   codecst   openR%   R&   t	   readlinest
   startswitht   stript   matchR2   t   replacet   intt
   ValueErrort   listRH   t   lenR9   t   searchR   t   strR   R   RE   t   endt   startt   removeR8   t
   isinstancet   update(   t   filenameRR   t   _variable_rxt   _findvar1_rxt   _findvar2_rxt   donet   notdoneR-   t   ft   linest   linet   mt   nt   vt   tmpvR5   t   renamed_variablesR4   RC   t   foundt   itemt   aftert   k(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _parse_makefile   s    	
2 #  






 c          C   sd   t  o t i i t d  St t d  o d t t i f }  n d }  t i i t	 d  |  d  S(   s    Return the path of the Makefile.t   Makefilet   abiflagss   config-%s%sR@   t   stdlib(
   R)   R   R   R   R   t   hasattrRa   t   _PY_VERSION_SHORTR   R   (   t   config_dir_name(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR   L  s    c         C   s   t    } y t | |   WnP t j
 oD } d | } t | d  o | d | i } n t |   n Xt   } y: t |  i i   } z | ~ } t	 | |   Wd QXWnP t j
 oD } d | } t | d  o | d | i } n t |   n Xt
 o |  d |  d <n d S(   s7   Initialize the module as appropriate for POSIX systems.s.   invalid Python installation: unable to open %st   strerrors    (%s)Nt	   BLDSHAREDt   LDSHARED(   R   R   t   IOErrorR   R   R   Ru   R%   R&   R   R)   (   RR   t   makefilet   et   msgt   config_hR-   R   (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _init_posixW  s&    	
	#
c         C   sq   t  d  |  d <t  d  |  d <t  d  |  d <d |  d <d	 |  d
 <t |  d <t i i t t i   |  d <d S(   s+   Initialize the module as appropriate for NTR   t   LIBDESTt
   platstdlibt
   BINLIBDESTR   t	   INCLUDEPYs   .pydt   SOs   .exet   EXEt   VERSIONt   BINDIRN(   R   t   _PY_VERSION_SHORT_NO_DOTR   R   t   dirnameR   Ra   t
   executable(   RR   (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _init_non_posixs  s    


c         C   s   | d j o
 h  } n t i d  } t i d  } x t o |  i   } | p Pn | i |  } | oL | i d d  \ } } y t |  } Wn t j
 o n X| | | <q8 | i |  } | o d | | i d  <q8 q8 W| S(   s   Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    s"   #define ([A-Z][A-Za-z0-9_]+) (.*)
s&   /[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
i   i   i    N(	   RO   Rr   Rs   R   t   readlineRy   R2   R{   R|   (   t   fpRR   t	   define_rxt   undef_rxR   R   R   R   (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR     s*    
 c          C   sY   t  o3 t i d j o t i i t d  }  qF t }  n t d  }  t i i |  d  S(   s   Return the path of pyconfig.h.R   t   PCR   s
   pyconfig.h(   R)   R   R4   R   R   R   R   (   t   inc_dir(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR     s    
c           C   s   t  t t i     S(   s,   Return a tuple containing the schemes names.(   R9   t   sortedR'   R:   (    (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR     s    c           C   s   t  i d  S(   s*   Return a tuple containing the paths names.R   (   R'   t   options(    (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR     s    c         C   s3   t    | o t |  |  St t i |    Sd S(   s   Return a mapping containing an install scheme.

    ``scheme`` is the install scheme name. If not provided, it will
    return the default scheme for the current platform.
    N(   R0   RT   R=   R'   R8   (   R/   RR   t   expand(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR     s    c         C   s   t  | | |  |  S(   s[   Return a path corresponding to the scheme.

    ``scheme`` is the install scheme name.
    (   R   (   R4   R/   RR   R   (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR     s    c          G   s  t  d" j och  a  t t  d <t t  d <t t  d <t t  d <t d t d t  d <t t  d <t t  d	 <t t  d
 <y t i t  d <Wn t	 j
 o d t  d <n Xt
 i d# j o t t   n t
 i d j o t t   n t i d j o t   t  d <n d t  j o t t  d <n t t  d  t  d <t o t
 i d j o t } y t
 i   } Wn t j
 o d" } n Xt
 i i t  d  o@ | | j o3 t
 i i | t  d  } t
 i i |  t  d <qn t i d j ot
 i   d } t | i d  d  } | d j  oS xNd$ D]D } t  | } t i d d |  } t i d d |  } | t  | <qWqld t
 i j oY t
 i d } xI d% D]= } t  | } t i d d |  } | d | } | t  | <qWn t  i d d  }	 t i  d |	  }
 |
 d" j	 od |
 i! d   } t
 i i" |  p> x; d& D]/ } t  | } t i d! d |  } | t  | <q-Wqhqlqpn |  o2 g  } x$ |  D] } | i# t  i |   qW| St  Sd" S('   sy  With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows and Mac OS it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    t   prefixt   exec_prefixt
   py_versiont   py_version_shorti    i   t   py_version_nodotRe   t   platbaset   projectbaseR   Rl   R   t   os2RN   s   2.6t   userbaset   srcdirR]   t   .i   Ro   t
   BASECFLAGSRn   t	   PY_CFLAGSR   s   -arch\s+\w+\st    s   -isysroot [^ 	]*t	   ARCHFLAGSs   -isysroot\s+(\S+)i   s   -isysroot\s+\S+(\s|$)N(   s   nts   os2(   s   LDFLAGSs
   BASECFLAGSs   CFLAGSs	   PY_CFLAGSs	   BLDSHARED(   s   LDFLAGSs
   BASECFLAGSs   CFLAGSs	   PY_CFLAGSs	   BLDSHARED(   s   LDFLAGSs
   BASECFLAGSs   CFLAGSs	   PY_CFLAGSs	   BLDSHARED($   t   _CONFIG_VARSRO   t   _PREFIXt   _EXEC_PREFIXt   _PY_VERSIONR   R   Ra   R   t   AttributeErrorR   R4   R   R   t   versionRg   R   R)   t   getcwdR   R   t   isabsR   RQ   Rb   t   unameR{   t   splitRr   R?   RE   R`   R   R2   t   existst   append(   RX   Re   t   cwdR   t   kernel_versiont   major_versionRL   t   flagst   archRn   R   t   sdkt   valsR4   (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR     s    






 
 
 
 c         C   s   t    i |   S(   s   Return the value of a single variable using the dictionary returned by
    'get_config_vars()'.

    Equivalent to get_config_vars().get(name)
    (   R   R`   (   R4   (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR   Q  s    c          C   s  t  i d j o d }  t i i |   } | d j o t i St i i d |  } t i | t |   | !i   } | d j o d S| d j o d St i St  i d	 j p t t  d
  o t i St  i	   \ } } } } } | i   i
 d d  } | i
 d d  } | i
 d d  } | d  d j o d | | f S| d  d j oA | d d j o, d } d t | d  d | d f } qn| d  d j o d | | f S| d  d j o d | | | f S| d  d j o? d } t i d   }	 |	 i |  }
 |
 o |
 i   } qni| d  d! j oWt   } | i d"  } t o | } y t d#  } Wn t j
 o qXz t i d$ | i    }
 Wd% | i   X|
 d% j	 o) d& i |
 i d'  i d&  d   } qn | p
 | } n | o| } d( } | d& d) j od* t   i d+ d  i   j o d, } t   i d+  } t i d- |  } t t t |    } t |  d' j o | d } q| d; j o
 d, } q| d< j o
 d1 } q| d= j o
 d2 } q| d> j o
 d4 } q| d? j o
 d5 } qt  d6 | f   q| d. j o t i! d@ j o
 d0 } qq| dA j o$ t i! dB j o
 d3 } qd/ } qqn d: | | | f S(C   s  Return a string that identifies the current platform.

    This is used mainly to distinguish platform-specific build directories and
    platform-specific built distributions.  Typically includes the OS name
    and version and the architecture (as supplied by 'os.uname()'),
    although the exact information included depends on the OS; eg. for IRIX
    the architecture isn't particularly important (IRIX only runs on SGI
    hardware), but for Linux the kernel version isn't particularly
    important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u
       irix-5.3
       irix64-6.2

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win-ia64 (64bit Windows on Itanium)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.
    R   s    bit (it   )t   amd64s	   win-amd64t   itaniums   win-ia64RN   R   t   /Rl   R   t   _t   -i   t   linuxs   %s-%st   sunosi    t   5t   solariss   %d.%si   i   i   t   irixt   aixs   %s-%s.%si   t   cygwins   [\d.]+R]   t   MACOSX_DEPLOYMENT_TARGETs0   /System/Library/CoreServices/SystemVersion.plists=   <key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>NR   i   t   macosxs   10.4.s   -archRn   t   fats   -arch\s+(\S+)t   i386t   ppct   x86_64t   intelt   fat3t   ppc64t   fat64t	   universals%   Don't know machine value for archs=%ri    t   PowerPCt   Power_Macintoshs   %s-%s-%s(   s   i386s   ppc(   s   i386s   x86_64(   s   i386s   ppcs   x86_64(   s   ppc64s   x86_64(   s   i386s   ppcs   ppc64s   x86_64I       (   s   PowerPCs   Power_MacintoshI       ("   R   R4   Ra   R   R"   Rb   R~   t   lowerR   R   Rz   R{   Rr   Rs   Ry   R2   R   R`   R   Ru   R   R   t   readt   closeRO   R   R   Rx   t   findallR9   R   R*   R|   t   maxsize(   R   t   it   jt   lookt   osnamet   hostt   releaseR   t   machinet   rel_reR   t   cfgvarst   macvert
   macreleaseR   t   cflagst   archs(    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR	   Z  s     !*		-
"





c           C   s   t  S(   N(   R   (    (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyR
     s    c         C   s\   xU t  t | i     D]; \ } \ } } | d j o d |  GHn d | | f GHq Wd  S(   Ni    s   %s: s
   	%s = "%s"(   t	   enumerateR   R8   (   t   titlet   datat   indexRL   RC   (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _print_dict   s
     c           C   sR   d t    GHd t   GHd t   GHd GHt d t    d GHt d t    d S(	   s*   Display all information sysconfig detains.s   Platform: "%s"s   Python version: "%s"s!   Current installation scheme: "%s"t   Pathst	   VariablesN(    (    (   R	   R
   RV   R  R   R   (    (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   _main  s    t   __main__(D   t   __doc__Rt   R   Rr   Ra   t   os.pathR    R   t   configparsert   ImportErrort   ConfigParsert   __all__R   R   R   R   R   R   R4   R   R   R   R)   R   R    R0   t   RawConfigParserR'   Rs   R>   RD   R   R   R   R   R   RQ   R   R   R   R   RO   R   t
   _USER_BASERG   RM   RT   RU   RV   Rg   R   R   R   R   R   R   R   R   R   R   R   R   R   R	   R
   R  R  t   __name__(    (    (    sb   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/distlib/_backport/sysconfig.pyt   <module>   s   		
''"'"				#							v													