INNER CODE UNIT · Python
create_readable_dir
kblin/ncbi-genome-download · ncbi_genome_download/core.py:508
def create_readable_dir(entry, section, domain, output):
"""Create the a human-readable directory to link the entry to if needed."""
if domain != 'viral':
full_output_dir = os.path.join(output, 'human_readable', section, domain,
get_genus_label(entry),
get_species_label(entry),
get_strain_label(entry))
else:
full_output_dir = os.path.join(output, 'human_readable', section, domain,
entry['organism_name'].replace(' ', '_'),
get_strain_label(entry, viral=True))
try:
os.makedirs(full_output_dir)
except OSError as err:
if err.errno == errno.EEXIST and os.path.isdir(full_output_dir):
pass
else: