Skip to content
Snippets Groups Projects
Commit 2633b7d3 authored by Loraine Gueguen's avatar Loraine Gueguen
Browse files

fix picture_path

parent b16675ce
No related branches found
No related tags found
1 merge request!18Release v2.1.0
This commit is part of merge request !18. Comments created here will be created in the context of that merge request.
...@@ -38,7 +38,7 @@ class DeploySpeciesStack(speciesData.SpeciesData): ...@@ -38,7 +38,7 @@ class DeploySpeciesStack(speciesData.SpeciesData):
""" """
def make_directory_tree(self, picture_path): def make_directory_tree(self):
""" """
Generate the directory tree for an organism Generate the directory tree for an organism
...@@ -77,18 +77,18 @@ class DeploySpeciesStack(speciesData.SpeciesData): ...@@ -77,18 +77,18 @@ class DeploySpeciesStack(speciesData.SpeciesData):
self.config.pop(constants.CONF_TRIPAL_BANNER_PATH, None) self.config.pop(constants.CONF_TRIPAL_BANNER_PATH, None)
# Copy the organism picture for tripal # Copy the organism picture for tripal
if picture_path is not None: if self.picture_path is not None:
if os.path.isfile(picture_path): if os.path.isfile(self.picture_path):
picture_path_basename = os.path.basename(picture_path) picture_path_basename = os.path.basename(self.picture_path)
picture_path_filename, picture_path_extension = os.path.splitext(picture_path_basename) picture_path_filename, picture_path_extension = os.path.splitext(picture_path_basename)
if picture_path_extension == ".png" or picture_path_extension == ".jpg": if picture_path_extension == ".png" or picture_path_extension == ".jpg":
picture_dest_name = "species%s" % picture_path_extension picture_dest_name = "species%s" % picture_path_extension
picture_dest_path = os.path.join(self.species_dir, picture_dest_name) picture_dest_path = os.path.join(self.species_dir, picture_dest_name)
shutil.copy(picture_path, picture_dest_path) shutil.copy(self.picture_path, picture_dest_path)
else: else:
logging.error("Specified organism picture has wrong extension (must be '.png' or '.jpg'): {0}".format(picture_path)) logging.error("Specified organism picture has wrong extension (must be '.png' or '.jpg'): {0}".format(self.picture_path))
else: else:
logging.error("Specified organism picture not found {0} for {1}".format(picture_path, self.genus_uppercase + " " + self.species)) logging.error("Specified organism picture not found {0} for {1}".format(self.picture_path, self.genus_uppercase + " " + self.species))
# Create nginx dirs and write/re-write nginx conf # Create nginx dirs and write/re-write nginx conf
make_dirs(dir_paths_li=["./nginx", "./nginx/conf"]) make_dirs(dir_paths_li=["./nginx", "./nginx/conf"])
...@@ -423,8 +423,8 @@ if __name__ == "__main__": ...@@ -423,8 +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) 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 # Make/update directory tree
picture_path = sp_picture_dict[deploy_stack_for_current_organism.genus_species] deploy_stack_for_current_organism.picture_path = sp_picture_dict[deploy_stack_for_current_organism.genus_species]
deploy_stack_for_current_organism.make_directory_tree(picture_path) deploy_stack_for_current_organism.make_directory_tree()
logging.info("Successfully generated the directory tree for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species) 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 # Make compose files
......
...@@ -69,7 +69,6 @@ class SpeciesData: ...@@ -69,7 +69,6 @@ class SpeciesData:
self.date = datetime.today().strftime("%Y-%m-%d") self.date = datetime.today().strftime("%Y-%m-%d")
self.origin = parameters_dictionary_description[constants.ORG_PARAM_DESC_ORIGIN] self.origin = parameters_dictionary_description[constants.ORG_PARAM_DESC_ORIGIN]
self.performed = parameters_dictionary_data[constants.ORG_PARAM_DATA_PERFORMED_BY] self.performed = parameters_dictionary_data[constants.ORG_PARAM_DATA_PERFORMED_BY]
self.picture_path = parameters_dictionary_description[constants.ORG_PARAM_DESC_PICTURE_PATH]
if parameters_dictionary_data[constants.ORG_PARAM_DATA_GENOME_VERSION] == "": if parameters_dictionary_data[constants.ORG_PARAM_DATA_GENOME_VERSION] == "":
self.genome_version = "1.0" self.genome_version = "1.0"
......
...@@ -42,7 +42,7 @@ services: ...@@ -42,7 +42,7 @@ services:
- ./banner.png:/var/www/html/banner.png:ro - ./banner.png:/var/www/html/banner.png:ro
{% endif %} {% endif %}
#- /groups/XXX/:/groups/XXX/:ro # We do this when we have symlinks in src_data pointing to /groups/XXX/... #- /groups/XXX/:/groups/XXX/:ro # We do this when we have symlinks in src_data pointing to /groups/XXX/...
{% if 'picture_path' is defined and 'picture_path' != '' %} {% if 'picture_path' is defined %}
{% if 'png' in picture_path %} {% if 'png' in picture_path %}
- ./species.png:/var/www/html/species.png:ro - ./species.png:/var/www/html/species.png:ro
{% endif %} {% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment