diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-10 12:43:23 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-10 12:43:23 -0400 |
commit | 6e757a7f0364d7a43ea2c2844b28690d30137661 (patch) | |
tree | d3a5ad74e3e040b55bea4fdacc965950fe9ff599 /ez_setup.py | |
parent | 87a0b2190cb40c18f5dd98e7842c197e17a452e2 (diff) | |
download | external_python_setuptools-6e757a7f0364d7a43ea2c2844b28690d30137661.tar.gz external_python_setuptools-6e757a7f0364d7a43ea2c2844b28690d30137661.tar.bz2 external_python_setuptools-6e757a7f0364d7a43ea2c2844b28690d30137661.zip |
Implemented download using wget
Diffstat (limited to 'ez_setup.py')
-rw-r--r-- | ez_setup.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/ez_setup.py b/ez_setup.py index 3b086260..3b41ab8b 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -160,11 +160,11 @@ download_file_powershell.viable = ( ) def download_file_curl(url, target): - cmd = ['curl %(url)r -o %(target)s'] + cmd = ['curl', url, '-o', target] subprocess.check_call(cmd) def has_curl(): - cmd = ['curl --version'] + cmd = ['curl', '--version'] try: subprocess.check_call(cmd) except: @@ -173,6 +173,20 @@ def has_curl(): download_file_curl.viable = has_curl +def download_file_wget(url, target): + cmd = ['wget', url, '-q', '-O', target] + subprocess.check_call(cmd) + +def has_wget(): + cmd = ['wget', '--version'] + try: + subprocess.check_call(cmd) + except: + return False + return True + +download_file_curl.viable = has_wget + def download_file_insecure(url, target): """ Use Python to download the file, even though it cannot authenticate the @@ -202,7 +216,7 @@ def get_best_downloader(): downloaders = [ download_file_powershell, download_file_curl, - #download_file_wget, + download_file_wget, download_file_insecure, ] |