INNER CODE UNIT · Python

create_dir

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

def create_dir(entry, section, domain, output, flat_output):
    """Create the output directory for the entry if needed."""
    if not flat_output:
        full_output_dir = os.path.join(output, section, domain, entry['assembly_accession'])
    else:
        full_output_dir = os.path.join(output)
    try:
        os.makedirs(full_output_dir)
    except OSError as err:
        if err.errno == errno.EEXIST and os.path.isdir(full_output_dir):
            pass
        else:
            raise

    return full_output_dir


def create_readable_dir(entry, section, domain, output):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…