From: crouzet Date: Thu, 20 Jan 2022 13:58:48 +0000 (+0100) Subject: hook permettant d'ajouter à l'application des modules utilisateur X-Git-Tag: V9_9_0~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9b53f549ffed77087e2de27c484535172ece1b8b;p=tools%2Fsat.git hook permettant d'ajouter à l'application des modules utilisateur --- 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