示例#1
0
文件: setup.py 项目: marzlia/fabio
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)
示例#2
0
文件: setup.py 项目: CPrescher/fabio
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)
示例#3
0
文件: setup.py 项目: lukasHD/pyFAI
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)
示例#4
0
文件: setup.py 项目: SulzmannFr/pyFAI
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)
示例#5
0
文件: setup.py 项目: payno/fabio
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)
示例#6
0
文件: setup.py 项目: decarlof/fabio
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)