ó
^†êWc           @@  sà  d  Z  d d l m 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 d l m Z e j d ƒ Z d	 Z d
 Z d „  Z d „  Z d „  Z e ƒ  rì e j j e j d ƒ Z n@ y e j j e j ƒ  d ƒ Z Wn e k
 r+e j d ƒ n Xe j j e ƒ Z e j  ƒ  Z! e j" Z# e d ƒ Z$ e re j j e j d ƒ Z% e j j e# d ƒ Z& e j j' e% ƒ sÔe j j e j d ƒ Z% e j j e# d ƒ Z& n  d Z( e j j e$ d ƒ Z) e j j e) e( ƒ Z* nŒ e j j e j d ƒ Z% e j j e# d ƒ Z& d Z( e j j e$ d ƒ Z) e j j e) e( ƒ Z* e j+ d  d k r“e j d  d k r“d Z% n  g  e j, d ƒ D] Z e j j e e( ƒ ^ q£Z- e. d d e. d d „ Z0 d S(   s7   Locations where we look for configs, install stuff, etci    (   t   absolute_importN(   t	   sysconfig(   t   installt   SCHEME_KEYS(   t   WINDOWSt
   expanduser(   t   appdirst   pips¹   This file is placed here by pip to indicate the source was put
here by pip.

Once this package is successfully installed this source code will be
deleted (unless you remove this file).
s   pip-delete-this-directory.txtc         C@  s>   t  j j |  t ƒ } t | d ƒ  } | j t ƒ Wd QXd S(   s?   
    Write the pip delete marker file into this directory.
    t   wN(   t   ost   patht   joint   PIP_DELETE_MARKER_FILENAMEt   opent   writet   DELETE_MARKER_MESSAGE(   t	   directoryt   filepatht	   marker_fp(    (    s^   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/locations.pyt   write_delete_marker_file   s    c           C@  s9   t  t d ƒ r t St j t t d t j ƒ k r5 t St S(   sM   
    Return True if we're running inside a virtualenv, False otherwise.

    t   real_prefixt   base_prefix(   t   hasattrt   syst   Truet   prefixt   getattrt   False(    (    (    s^   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/locations.pyt   running_under_virtualenv'   s
    c          C@  sY   t  j j t  j j t j ƒ ƒ }  t  j j |  d ƒ } t ƒ  rU t  j j | ƒ rU t	 Sd S(   s?   
    Return True if in a venv and no system site packages.
    s   no-global-site-packages.txtN(
   R	   R
   t   dirnamet   abspatht   sitet   __file__R   R   t   isfileR   (   t   site_mod_dirt   no_global_file(    (    s^   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/locations.pyt   virtualenv_no_global4   s    !t   srcs=   The folder you are executing pip from can no longer be found.t   ~t   Scriptst   bins   pip.inis   pip.confs   .pipi   t   darwini   s   /System/Library/s   /usr/local/binc         C@  s÷  d d l  m } i  } | r/ i d g d 6} n i  } i |  d 6}	 |	 j | ƒ | |	 ƒ }
 |
 j ƒ  |
 j d d t ƒ} | oƒ | sŸ t d j | | ƒ ƒ ‚ | p« | j | _ | rÃ d	 | _	 n  | pÏ | j	 | _	 | pá | j
 | _
 | pó | j | _ | j ƒ  x% t D] } t | d
 | ƒ | | <q
Wd |
 j d ƒ k re| j t d | j d | j ƒ ƒ n  t ƒ  rót j j t j	 d d d t j d  |  ƒ | d <| d k	 rót j j t j j | d ƒ ƒ d } t j j | | d ƒ | d <qón  | S(   s+   
    Return a distutils install scheme
    i    (   t   Distributions   --no-user-cfgt   script_argst   nameR   t   creates   user={0} prefix={1}t    t   install_t   install_libt   purelibt   platlibt   includeR   t   pythoni   t   headersi   N(   t   distutils.distR*   t   updatet   parse_config_filest   get_command_objR   t   AssertionErrort   formatt   userR   t   homet   roott   finalize_optionsR   R   t   get_option_dictt   dictR0   R   R	   R
   R   R   t   versiont   Nonet
   splitdriveR   (   t	   dist_nameR<   R=   R>   t   isolatedR   R*   t   schemet   extra_dist_argst	   dist_argst   dt   it   keyt   path_no_drive(    (    s^   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/locations.pyt   distutils_scheme|   sH    
%
%				(1   t   __doc__t
   __future__R    R	   t   os.pathR   R   t	   distutilsR   t   distutils.command.installR   R   t
   pip.compatR   R   t	   pip.utilsR   t   user_cache_dirt   USER_CACHE_DIRR   R   R   R   R$   R
   R   R   t
   src_prefixt   getcwdt   OSErrort   exitR   t   get_python_libt   site_packagest	   USER_SITEt	   user_sitet   user_dirt   bin_pyt   bin_usert   existst   config_basenamet   legacy_storage_dirt   legacy_config_filet   platformt   site_config_dirst   site_config_filesR   RC   RN   (    (    (    s^   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/locations.pyt   <module>   sd   										&	.	