def download_images(): """ Download all test images and """ root_dir = os.path.dirname(os.path.abspath(__file__)) test_dir = os.path.join(root_dir, PROJECT, "test") sys.path.insert(0, test_dir) from utilstest import UtilsTest image_home = os.path.join(root_dir, "testimages") testimages = os.path.join(root_dir, "all_testimages.json") UtilsTest.image_home = image_home UtilsTest.testimages = testimages if os.path.exists(testimages): import json with open(testimages) as f: all_files = set(json.load(f)) else: raise(RuntimeError("Please run 'python setup.py build test' to download all images")) for afile in all_files.copy(): if afile.endswith(".bz2"): all_files.add(afile[:-4] + ".gz") all_files.add(afile[:-4]) elif afile.endswith(".gz"): all_files.add(afile[:-3] + ".bz2") all_files.add(afile[:-3]) else: all_files.add(afile + ".gz") all_files.add(afile + ".bz2") UtilsTest.download_images(all_files) return list(all_files)
def download_images(): """ Download all test images and """ root_dir = os.path.dirname(os.path.abspath(__file__)) test_dir = os.path.join(root_dir, PROJECT, "test") sys.path.insert(0, test_dir) from utilstest import UtilsTest image_home = os.path.join(root_dir, "testimages") testimages = os.path.join(root_dir, "all_testimages.json") UtilsTest.image_home = image_home UtilsTest.testimages = testimages if os.path.exists(testimages): import json with open(testimages) as f: all_files = set(json.load(f)) else: raise (RuntimeError( "Please run 'python setup.py build test' to download all images")) for afile in all_files.copy(): if afile.endswith(".bz2"): all_files.add(afile[:-4] + ".gz") all_files.add(afile[:-4]) elif afile.endswith(".gz"): all_files.add(afile[:-3] + ".bz2") all_files.add(afile[:-3]) else: all_files.add(afile + ".gz") all_files.add(afile + ".bz2") UtilsTest.download_images(all_files) return list(all_files)
def download_images(): """ Download all test images and """ test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test") sys.path.insert(0, test_dir) from utilstest import UtilsTest UtilsTest.download_images() return list(UtilsTest.ALL_DOWNLOADED_FILES)
def download_images(): """ Download all test images and """ test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test") sys.path.insert(0, test_dir) from utilstest import UtilsTest UtilsTest.download_images() return list(UtilsTest.ALL_DOWNLOADED_FILES)
def download_images(): """ Download all test images and """ test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test") sys.path.insert(0, test_dir) from utilstest import UtilsTest for afile in UtilsTest.ALL_DOWNLOADED_FILES.copy(): if afile.endswith(".bz2"): UtilsTest.ALL_DOWNLOADED_FILES.add(afile[:-4] + ".gz") UtilsTest.ALL_DOWNLOADED_FILES.add(afile[:-4]) elif afile.endswith(".gz"): UtilsTest.ALL_DOWNLOADED_FILES.add(afile[:-3] + ".bz2") UtilsTest.ALL_DOWNLOADED_FILES.add(afile[:-3]) else: UtilsTest.ALL_DOWNLOADED_FILES.add(afile + ".gz") UtilsTest.ALL_DOWNLOADED_FILES.add(afile + ".bz2") UtilsTest.download_images() return list(UtilsTest.ALL_DOWNLOADED_FILES)
def download_images(): """ Download all test images and """ test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test") sys.path.insert(0, test_dir) from utilstest import UtilsTest for afile in UtilsTest.ALL_DOWNLOADED_FILES.copy(): if afile.endswith(".bz2"): UtilsTest.ALL_DOWNLOADED_FILES.add(afile[:-4] + ".gz") UtilsTest.ALL_DOWNLOADED_FILES.add(afile[:-4]) elif afile.endswith(".gz"): UtilsTest.ALL_DOWNLOADED_FILES.add(afile[:-3] + ".bz2") UtilsTest.ALL_DOWNLOADED_FILES.add(afile[:-3]) else: UtilsTest.ALL_DOWNLOADED_FILES.add(afile + ".gz") UtilsTest.ALL_DOWNLOADED_FILES.add(afile + ".bz2") UtilsTest.download_images() return list(UtilsTest.ALL_DOWNLOADED_FILES)