Salome HOME
Merge branch 'V8_0_BR' V8_0_0a2 V8_0_0b1
authorvsr <vsr@opencascade.com>
Thu, 14 Jan 2016 14:43:45 +0000 (17:43 +0300)
committervsr <vsr@opencascade.com>
Thu, 14 Jan 2016 14:43:45 +0000 (17:43 +0300)
src/SalomeApp/SalomeApp_Engine_i.cxx
src/SalomeApp/pluginsdemo/CMakeLists.txt
src/SalomeApp/salome_pluginsmanager.py

index b26a8424cb7b8c9a0b736e6684cfd298b0159663..956993d33dad5c4231f9affbc9f309f970e9c495 100644 (file)
@@ -361,6 +361,9 @@ CORBA::Object_ptr SalomeApp_Engine_i::EngineForComponent( const char* theCompone
   if ( !theComponentName || !strlen( theComponentName ) )
     return anEngine._retn();
 
+  if ( SalomeApp_Application::moduleTitle( theComponentName ).isEmpty() )
+    return anEngine._retn();
+
   std::string aPath( "/SalomeAppEngine/" );
   aPath += theComponentName;
   anEngine = namingService()->Resolve( aPath.c_str() );
index f8ec9d6fbb31884778ad30720e3610beef759f83..9e997c7f90bda7cc2b4b4096c91f35810997c5a8 100755 (executable)
@@ -38,9 +38,12 @@ SET(_plugins_SCRIPTS
   tubebuilder.py
   salome_plugins.py
   smesh_plugins.py
+)
+SET(_helper_SCRIPTS
   xalome.py
 )
 
 # --- rules ---
 
 SALOME_INSTALL_SCRIPTS("${_plugins_SCRIPTS}" ${SALOME_GUI_INSTALL_PLUGINS}/demo DEF_PERMS)
+SALOME_INSTALL_SCRIPTS("${_helper_SCRIPTS}" ${SALOME_INSTALL_PYTHON})
index 10bf174fd58f2c1516df8702721c7e0e32c10d4c..482d9d3ee7205ed1c67fc5809268e7b4cb8b2388 100644 (file)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 # Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 
 """
 This module is imported from C++ SalomeApp_Application and initialized
-(call to initialize function with 4 parameters) module : 0 if it's
-plugins manager at the application level 1 if it is at the module
-level name : the name of the plugins manager. This name is used to
-build the name of the plugins files basemenuname : the name of the
-menu into we want to add the menu of the plugins ("Tools" for example)
-menuname : the name of plugins menu
+(call to initialize function with 4 parameters)
+module :       0 if it is plugins manager at the application level, 1 if it is at the module level
+name :         the name of the plugins manager. This name is used to build the name of the plugins files
+basemenuname : the name of the menu into we want to add the menu of the plugins ("Tools" for example)
+menuname :     the name of plugins menu
 
 A plugins manager is created when calling initialize.
 
@@ -54,8 +54,7 @@ AddFunction.  It is possible to customize this presentation by getting
 the entries list (salome_pluginsmanager.entries()) and modifying it in
 place. For example, you can do that :
 salome_pluginsmanager.entries().sort() to order them alphabetically or
-salome_pluginsmanager.entries().remove("a") to remove the entry named
-"a".
+salome_pluginsmanager.entries().remove("a") to remove the entry named "a".
 
 It is possible to put entries in submenus. You only need to give a
 name with / to the entry. for example::
@@ -276,8 +275,10 @@ class PluginsManager:
           self.entries=[]
           self.lasttime=lasttime
           for directory,plugins_file in plugins_files:
+            logger.debug("look for python path: %s"%directory)
             if directory not in sys.path:
               sys.path.insert(0,directory)
+              logger.debug("The directory %s has been added to PYTHONPATH"%directory)
             try:
               execfile(plugins_file,globals(),{})
             except: