minor correction:

to avoid the critical message of PluginsManager when SMESH_PYPLUGIN_DIR are not declared
This commit is contained in:
DUC ANH HOANG 2024-11-12 11:24:56 +01:00
parent 49eb5ff195
commit e60bcaf4a9

View File

@ -122,10 +122,12 @@ import sys
import importlib import importlib
import importlib.util import importlib.util
plugin_dirs = os.getenv("SMESH_PYPLUGIN_DIR").split(":") smesh_pyplugin_dir = os.getenv("SMESH_PYPLUGIN_DIR")
# reverse plugin_dirs list to call smesh python plugin in good order if smesh_pyplugin_dir:
plugin_dirs.reverse() plugin_dirs = smesh_pyplugin_dir.split(":")
for plg_dir in plugin_dirs: # reverse plugin_dirs list to call smesh python plugin in good order
plugin_dirs.reverse()
for plg_dir in plugin_dirs:
if os.path.exists(plg_dir): if os.path.exists(plg_dir):
sys.path.insert(0, plg_dir) sys.path.insert(0, plg_dir)
#for filename in sorted( #for filename in sorted(