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

Updated ATNT path

parent 4b6f55c4
Pipeline #34456 passed with stages
in 16 minutes and 6 seconds
......@@ -8,7 +8,7 @@ import os
import sys
import functools
from nose.plugins.skip import SkipTest
from import download_and_unzip
# based on:
class Quiet(object):
......@@ -91,31 +91,20 @@ def atnt_database_directory():
if os.path.exists(atnt_default_directory):
return atnt_default_directory
import sys, tempfile
if sys.version_info[0] <= 2:
import urllib2 as urllib
import urllib.request as urllib
# TODO: THIS SHOULD BE A CLASS METHOD OF bob.db.atnt database
source_url = ['',
import tempfile
atnt_downloaded_directory = tempfile.mkdtemp(prefix='atnt_db_')
db_url = ""
logger.warn("Downloading the AT&T database from '%s' to '%s' ...", db_url, atnt_downloaded_directory)
logger.warn("Downloading the AT&T database from '%s' to '%s' ...", source_url, atnt_downloaded_directory)
logger.warn("To avoid this, please download the database manually, extract the data and set the ATNT_DATABASE_DIRECTORY environment variable to this directory.")
# to avoid re-downloading in parallel test execution
os.environ['ATNT_DATABASE_DIRECTORY'] = atnt_downloaded_directory
# download
url = urllib.urlopen(db_url)
local_zip_file = os.path.join(atnt_downloaded_directory, '')
dfile = open(local_zip_file, 'wb')
# unzip
import zipfile
zip = zipfile.ZipFile(local_zip_file)
if not os.path.exists(atnt_downloaded_directory):
download_and_unzip(source_url, os.path.join(atnt_downloaded_directory, ""))
return atnt_downloaded_directory
Markdown is supported
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