diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-10 12:35:20 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-10 12:35:20 -0400 |
commit | 7beb55ea03e3c355b61d73e6237e26522808924e (patch) | |
tree | 8a15f8380cabb8b8a330aa88ca07528de4535d4d /ez_setup.py | |
parent | a92a6e82465fc8fca4d14a4380125f62b8bc33f0 (diff) | |
download | python-setuptools-bitbucket-7beb55ea03e3c355b61d73e6237e26522808924e.tar.gz |
Implemented curl support for bootstrapping.
Diffstat (limited to 'ez_setup.py')
-rw-r--r-- | ez_setup.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ez_setup.py b/ez_setup.py index 98d15f22..3b086260 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -159,6 +159,20 @@ download_file_powershell.viable = ( lambda: platform.name() == 'Windows' and platform.win32_ver()[1] >= '6' ) +def download_file_curl(url, target): + cmd = ['curl %(url)r -o %(target)s'] + subprocess.check_call(cmd) + +def has_curl(): + cmd = ['curl --version'] + try: + subprocess.check_call(cmd) + except: + return False + return True + +download_file_curl.viable = has_curl + def download_file_insecure(url, target): """ Use Python to download the file, even though it cannot authenticate the @@ -187,7 +201,7 @@ download_file_insecure.viable = lambda: True def get_best_downloader(): downloaders = [ download_file_powershell, - #download_file_curl, + download_file_curl, #download_file_wget, download_file_insecure, ] |