INNER CODE UNIT · Python

worker

kblin/ncbi-genome-download · ncbi_genome_download/core.py:386

def worker(job):
    """Run a single download job."""
    logger = logging.getLogger("ncbi-genome-download")
    ret = False
    try:
        if job.full_url is not None:
            req = requests.get(job.full_url, stream=True)
            ret = save_and_check(req, job.local_file, job.expected_checksum)
            if not ret:
                return ret
        ret = create_symlink(job.local_file, job.symlink_path)
    except KeyboardInterrupt:  # pragma: no cover
        # TODO: Actually test this once I figure out how to do this in py.test
        logger.debug("Ignoring keyboard interrupt.")

    return ret

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…