From 6d9203b8255ef06f3d15764b1d05750e2a8bc422 Mon Sep 17 00:00:00 2001 From: Loraine Gueguen <loraine.gueguen@sb-roscoff.fr> Date: Tue, 4 May 2021 13:56:26 +0200 Subject: [PATCH] Fix banner --- gga_init.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gga_init.py b/gga_init.py index cbd7604..becedb2 100755 --- a/gga_init.py +++ b/gga_init.py @@ -62,12 +62,10 @@ class DeploySpeciesStack(speciesData.SpeciesData): # use the default banner instead if "banner_path" in self.config.keys(): if not config["banner_path"] == "" and os.path.isfile(os.path.abspath(config["banner_path"])): - try: - logging.info("Custom banner path: %s" % self.config["banner_path"]) - shutil.copy(os.path.abspath(self.config["banner_path"]), "%s/banner.png" % self.species_dir) - except FileNotFoundError: - logging.warning("Could not copy specified banner (%s), using default banner instead" % self.config["banner_path"]) - self.config.pop("banner_path", None) + banner_dest_path = os.path.join(self.main_dir,"/banner.png") + logging.info("Custom banner path: %s" % self.config["banner_path"]) + if os.path.isfile(os.path.abspath(config["banner_path"])) != banner_dest_path: + shutil.copy(os.path.abspath(self.config["banner_path"]), banner_dest_path) else: logging.debug("Using default banner for Tripal pages") self.config.pop("banner_path", None) -- GitLab