- # look for NAMEOFPlugin.xml file among resource files
- resource_dir = os.path.join(plugin_root,"share",salome_subdir,"resources",plugin.lower())
- if not os.access( resource_dir, os.F_OK ): continue
- for resource_file in os.listdir( resource_dir ):
- if not resource_file.endswith( ".xml") or \
- resource_file.lower() != plugin.lower() + ".xml":
- continue
- # use "resources" attribute of "meshers-group" as name of plugin in a right case
- from xml.dom.minidom import parse
- xml_doc = parse( os.path.join( resource_dir, resource_file ))
- meshers_nodes = xml_doc.getElementsByTagName("meshers-group")
- if not meshers_nodes or not meshers_nodes[0].hasAttribute("resources"): continue
- plugin = meshers_nodes[0].getAttribute("resources")
- if plugin in plugin_list: continue
+ # setup environment needed for plugin
+ add_path(osp.join(plugin_root, 'bin', salome_subdir), 'PATH')
+ add_path(osp.join(plugin_root, get_lib_dir(), salome_subdir), 'PATH' \
+ if sys.platform == 'win32' else 'LD_LIBRARY_PATH')
+ add_path(osp.join(plugin_root, 'bin', salome_subdir), 'PYTHONPATH')
+ add_path(osp.join(plugin_root, get_lib_dir(), salome_subdir), 'PYTHONPATH')
+ add_path(osp.join(plugin_root, get_lib_dir(), py_version, 'site-packages',
+ salome_subdir), 'PYTHONPATH')