INNER CODE UNIT · Python
create_downloadjob
kblin/ncbi-genome-download · ncbi_genome_download/core.py:447
def create_downloadjob(entry, domain, config):
"""Create download jobs for all file formats from a summary file entry."""
logger = logging.getLogger("ncbi-genome-download")
logger.info('Checking record %r', entry['assembly_accession'])
full_output_dir = create_dir(entry, config.section, domain, config.output, config.flat_output)
symlink_path = None
if config.human_readable:
symlink_path = create_readable_dir(entry, config.section, domain, config.output)
if not config.flat_output:
checksum_path = Path(full_output_dir) / 'MD5SUMS'
# if the MD5SUM file is missing or too old, redownload
if not checksum_path.exists() or checksum_path.stat().st_mtime + (config.md5_cache_days * 24 * 60 * 60) < time.time():
checksums = grab_checksums_file(entry)
if not checksums:
return []