Skip to content
Snippets Groups Projects

fixes

Merged Loraine Gueguen requested to merge picture into dev
2 files
+ 28
12
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 11
9
@@ -38,7 +38,7 @@ class DeploySpeciesStack(speciesData.SpeciesData):
"""
def make_directory_tree(self):
def make_directory_tree(self, picture_path):
"""
Generate the directory tree for an organism
@@ -76,19 +76,19 @@ class DeploySpeciesStack(speciesData.SpeciesData):
logging.debug("Using default banner for Tripal pages")
self.config.pop(constants.CONF_TRIPAL_BANNER_PATH, None)
# Copy the organism picture for tripal if one was specified in the input species
if self.picture_path is not None:
if os.path.isfile(self.picture_path):
picture_path_basename = os.path.basename(self.picture_path)
# Copy the organism picture for tripal
if picture_path is not None:
if os.path.isfile(picture_path):
picture_path_basename = os.path.basename(picture_path)
picture_path_filename, picture_path_extension = os.path.splitext(picture_path_basename)
if picture_path_extension == ".png" or picture_path_extension == ".jpg":
picture_dest_name = "species%s" % picture_path_extension
picture_dest_path = os.path.join(self.species_dir, picture_dest_name)
shutil.copy(self.picture_path, picture_dest_path)
shutil.copy(picture_path, picture_dest_path)
else:
logging.error("Specified organism picture has wrong extension (must be '.png' or '.jpg'): {0}".format(self.picture_path))
logging.error("Specified organism picture has wrong extension (must be '.png' or '.jpg'): {0}".format(picture_path))
else:
logging.error("Specified organism picture not found {0} for {1}".format(self.picture_path, self.genus_uppercase + " " + self.species))
logging.error("Specified organism picture not found {0} for {1}".format(picture_path, self.genus_uppercase + " " + self.species))
# Create nginx dirs and write/re-write nginx conf
make_dirs(dir_paths_li=["./nginx", "./nginx/conf"])
@@ -402,6 +402,7 @@ if __name__ == "__main__":
make_traefik_compose_files(config=config, main_dir=main_dir)
unique_sp_dict_list = utilities.get_unique_species_dict_list(sp_dict_list=sp_dict_list)
sp_picture_dict = utilities.get_sp_picture(sp_dict_list=sp_dict_list)
logging.info("Deploying stacks for organisms in input file %s" % args.input)
for sp_dict in unique_sp_dict_list:
@@ -422,7 +423,8 @@ if __name__ == "__main__":
logging.info("gga_init.py called for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species)
# Make/update directory tree
deploy_stack_for_current_organism.make_directory_tree()
picture_path = sp_picture_dict[deploy_stack_for_current_organism.genus_species]
deploy_stack_for_current_organism.make_directory_tree(picture_path)
logging.info("Successfully generated the directory tree for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species)
# Make compose files
Loading