From ab3aa6dad3749a1c82c94874354fefe24a81037e Mon Sep 17 00:00:00 2001 From: Mario Ostieri Date: Mon, 10 Jun 2024 08:58:17 +0100 Subject: [PATCH] add temporary backdoor to allow ADR upgrade of jquery library --- src/ansys/pyensight/core/renderable.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ansys/pyensight/core/renderable.py b/src/ansys/pyensight/core/renderable.py index e95644ed7b3..212100868c5 100644 --- a/src/ansys/pyensight/core/renderable.py +++ b/src/ansys/pyensight/core/renderable.py @@ -382,10 +382,19 @@ def update(self): html = fp.read() # copy some files from Nexus cmd = "import shutil, enve, ceiversion, os.path\n" - for script in ["jquery-3.4.1.min.js", "geotiff.js", "geotiff_nexus.js", "bootstrap.min.js"]: - name = "os.path.join(enve.home(), f'nexus{ceiversion.nexus_suffix}', 'django', " - name += f"'website', 'static', 'website', 'scripts', '{script}')" + base_name = "os.path.join(enve.home(), f'nexus{ceiversion.nexus_suffix}', 'django', " + base_name += "'website', 'static', 'website', 'scripts', " + for script in ["geotiff.js", "geotiff_nexus.js", "bootstrap.min.js"]: + name = base_name + f"'{script}')" cmd += f'shutil.copy({name}, r"""{self._session.launcher.session_directory}""")\n' + jquery = ["jquery-3.4.1.min.js", "jquery.min.js"] + cmd = "import shutil, enve, ceiversion, os.path\n" + for script in jquery: + name = base_name + f"'{script}')" + cmd += "try:" + cmd += f' shutil.copy({name}, r"""{self._session.launcher.session_directory}""")\n' + cmd += "except Exception:" + cmd += " pass" name = "os.path.join(enve.home(), f'nexus{ceiversion.nexus_suffix}', 'django', " name += "'website', 'static', 'website', 'content', 'bootstrap.min.css')" cmd += f'shutil.copy({name}, r"""{self._session.launcher.session_directory}""")\n'