Skip to content

Commit

Permalink
#309 add global config file support
Browse files Browse the repository at this point in the history
  • Loading branch information
dgladkov committed Mar 18, 2013
1 parent 5d02b52 commit 2b5029c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pip/baseparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import textwrap
from distutils.util import strtobool
from pip.backwardcompat import ConfigParser, string_types, ssl
from pip.locations import default_config_file, default_log_file
from pip.locations import default_config_file, default_log_file, global_config_file
from pip.util import get_terminal_size, get_prog


Expand Down Expand Up @@ -137,7 +137,7 @@ def get_config_files(self):
config_file = os.environ.get('PIP_CONFIG_FILE', False)
if config_file and os.path.exists(config_file):
return [config_file]
return [default_config_file]
return [global_config_file, default_config_file]

def update_defaults(self, defaults):
"""Updates the given defaults with values from the config files and
Expand Down
3 changes: 3 additions & 0 deletions pip/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,14 @@ def _get_build_prefix():
default_storage_dir = os.path.join(user_dir, 'pip')
default_config_file = os.path.join(default_storage_dir, 'pip.ini')
default_log_file = os.path.join(default_storage_dir, 'pip.log')
global_config_file = os.path.join(os.environ['ALLUSERSPROFILE'],
'Application Data', 'pip', 'pip.ini')
else:
bin_py = os.path.join(sys.prefix, 'bin')
default_storage_dir = os.path.join(user_dir, '.pip')
default_config_file = os.path.join(default_storage_dir, 'pip.conf')
default_log_file = os.path.join(default_storage_dir, 'pip.log')
global_config_file = '/etc/pip.conf'

# Forcing to use /usr/local/bin for standard Mac OS X framework installs
# Also log to ~/Library/Logs/ for use with the Console.app log viewer
Expand Down

0 comments on commit 2b5029c

Please sign in to comment.