Simplify download with urllib.urlretrieve

This commit is contained in:
vitaut 2015-05-24 08:03:22 -07:00
parent ce5ab7d68f
commit d8a3b74664

View File

@ -2,7 +2,7 @@
# Build the project on Travis CI. # Build the project on Travis CI.
from __future__ import print_function from __future__ import print_function
import errno, os, re, shutil, sys, tempfile, urllib2 import errno, os, re, shutil, sys, tempfile, urllib
from subprocess import call, check_call, Popen, PIPE, STDOUT from subprocess import call, check_call, Popen, PIPE, STDOUT
def rmtree_if_exists(dir): def rmtree_if_exists(dir):
@ -25,10 +25,8 @@ if build == 'Doc':
check_call(['sudo', 'apt-get', 'install', 'python-virtualenv', 'nodejs']) check_call(['sudo', 'apt-get', 'install', 'python-virtualenv', 'nodejs'])
check_call(['npm', 'install', '-g', 'less', 'less-plugin-clean-css']) check_call(['npm', 'install', '-g', 'less', 'less-plugin-clean-css'])
deb_file = 'doxygen_1.8.6-2_amd64.deb' deb_file = 'doxygen_1.8.6-2_amd64.deb'
response = urllib2.urlopen('http://mirrors.kernel.org/ubuntu/pool/main/d/doxygen/' + urllib.urlretrieve('http://mirrors.kernel.org/ubuntu/pool/main/d/doxygen/' +
deb_file) deb_file, deb_file)
with open(deb_file, 'wb') as f:
f.write(response.read())
check_call(['sudo', 'dpkg', '-i', deb_file]) check_call(['sudo', 'dpkg', '-i', deb_file])
cppformat_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) cppformat_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(0, os.path.join(cppformat_dir, 'doc')) sys.path.insert(0, os.path.join(cppformat_dir, 'doc'))