Commit fb0424da authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Using bob.extension download script

parent 4acdc2cc
Pipeline #34393 passed with stage
in 5 minutes and 7 seconds
......@@ -9,6 +9,7 @@ import os
import sys
import pkg_resources
from bob.db.base.driver import Interface as BaseInterface
from import download_and_unzip
def dumplist(args):
......@@ -118,28 +119,13 @@ def download(arguments):
source_url = ''
import tempfile
import zipfile
if sys.version_info[0] <= 2:
import urllib2 as urllib
import urllib.request as urllib
if not arguments.quiet:
print ("Extracting url `%s' into `%s'" %(source_url, arguments.output_dir))
u = urllib.urlopen(source_url)
f = tempfile.NamedTemporaryFile(suffix = ".zip")
open(, 'wb').write(
z = zipfile.ZipFile(f, mode='r')
members = z.infolist()
for k,m in enumerate(members):
if not arguments.quiet:
print("x [%d/%d] %s" % (k+1, len(members), m.filename,))
z.extract(m, arguments.output_dir)
source_url = ['',
if not os.path.exists(arguments.output_dir):
download_and_unzip(source_url, os.path.join(arguments.output_dir, ""))
return 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment