~mdragon/nova/multi-tenant-accounting

« back to all changes in this revision

Viewing changes to test/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg/pip/locations.py

  • Committer: Tarmac
  • Author(s): Anne Gentle
  • Date: 2011-02-26 17:50:42 UTC
  • mfrom: (747.1.1 delpeskytest)
  • Revision ID: tarmac-20110226175042-htwnmds3fydg3ny1
Did a pull from trunk to be sure I had the latest, then deleted the test directory. I guess it appeared when I started using venv. Doh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""Locations where we look for configs, install stuff, etc"""
2
 
 
3
 
import sys
4
 
import os
5
 
from distutils import sysconfig
6
 
 
7
 
 
8
 
def running_under_virtualenv():
9
 
    """
10
 
    Return True if we're running inside a virtualenv, False otherwise.
11
 
 
12
 
    """
13
 
    return hasattr(sys, 'real_prefix')
14
 
 
15
 
 
16
 
if running_under_virtualenv():
17
 
    ## FIXME: is build/ a good name?
18
 
    build_prefix = os.path.join(sys.prefix, 'build')
19
 
    src_prefix = os.path.join(sys.prefix, 'src')
20
 
else:
21
 
    ## FIXME: this isn't a very good default
22
 
    build_prefix = os.path.join(os.getcwd(), 'build')
23
 
    src_prefix = os.path.join(os.getcwd(), 'src')
24
 
 
25
 
# FIXME doesn't account for venv linked to global site-packages
26
 
 
27
 
site_packages = sysconfig.get_python_lib()
28
 
user_dir = os.path.expanduser('~')
29
 
if sys.platform == 'win32':
30
 
    bin_py = os.path.join(sys.prefix, 'Scripts')
31
 
    # buildout uses 'bin' on Windows too?
32
 
    if not os.path.exists(bin_py):
33
 
        bin_py = os.path.join(sys.prefix, 'bin')
34
 
    user_dir = os.environ.get('APPDATA', user_dir) # Use %APPDATA% for roaming
35
 
    default_storage_dir = os.path.join(user_dir, 'pip')
36
 
    default_config_file = os.path.join(default_storage_dir, 'pip.ini')
37
 
    default_log_file = os.path.join(default_storage_dir, 'pip.log')
38
 
else:
39
 
    bin_py = os.path.join(sys.prefix, 'bin')
40
 
    default_storage_dir = os.path.join(user_dir, '.pip')
41
 
    default_config_file = os.path.join(default_storage_dir, 'pip.conf')
42
 
    default_log_file = os.path.join(default_storage_dir, 'pip.log')
43
 
    # Forcing to use /usr/local/bin for standard Mac OS X framework installs
44
 
    if sys.platform[:6] == 'darwin' and sys.prefix[:16] == '/System/Library/':
45
 
        bin_py = '/usr/local/bin'