From 9b53f549ffed77087e2de27c484535172ece1b8b Mon Sep 17 00:00:00 2001 From: crouzet Date: Thu, 20 Jan 2022 14:58:48 +0100 Subject: [PATCH] =?utf8?q?hook=20permettant=20d'ajouter=20=C3=A0=20l'appli?= =?utf8?q?cation=20des=20modules=20utilisateur?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/fileEnviron.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/fileEnviron.py b/src/fileEnviron.py index 3fe41c8..e74290a 100644 --- a/src/fileEnviron.py +++ b/src/fileEnviron.py @@ -904,6 +904,21 @@ def main(args): """ launcher_tail_py2="""\ + #[hook to integrate in launcher additionnal user modules] + + # Load all files extra.env.d/*.py and call the module's init routine] + + if os.path.exists("extra.env.d"): + sys.path.insert(0, os.path.join(os.getcwd(), "extra.env.d")) + for filename in os.listdir("extra.env.d"): + if filename.endswith(".py"): + f = os.path.join("extra.env.d", filename) + module_name = os.path.splitext(os.path.basename(f))[0] + fp, path, desc = imp.find_module(module_name) + module = imp.load_module(module_name, fp, path, desc) + module.init(context, out_dir_Path) + + #[manage salome doc command] if len(args) >1 and args[0]=='doc': _showDoc(args[1:]) return @@ -937,6 +952,21 @@ if __name__ == "__main__": """ launcher_tail_py3="""\ + #[hook to integrate in launcher additionnal user modules] + + # Load all files extra.env.d/*.py and call the module's init routine] + + if os.path.exists("extra.env.d"): + sys.path.insert(0, os.path.join(os.getcwd(), "extra.env.d")) + for filename in os.listdir("extra.env.d"): + if filename.endswith(".py"): + f = os.path.join("extra.env.d", filename) + module_name = os.path.splitext(os.path.basename(f))[0] + fp, path, desc = imp.find_module(module_name) + module = imp.load_module(module_name, fp, path, desc) + module.init(context, out_dir_Path) + + #[manage salome doc command] if len(args) >1 and args[0]=='doc': _showDoc(args[1:]) return -- 2.39.2