From: vsv Date: Tue, 17 Jan 2017 08:58:16 +0000 (+0300) Subject: Issue #1896: Do not send message about errors in initConfig script X-Git-Tag: V_2.7.0~333 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d36a44bebc13ef15510f2e7693deea86418bad1c;p=modules%2Fshaper.git Issue #1896: Do not send message about errors in initConfig script --- diff --git a/src/Config/Config_ModuleReader.cpp b/src/Config/Config_ModuleReader.cpp index ddb274240..9e8549cdb 100644 --- a/src/Config/Config_ModuleReader.cpp +++ b/src/Config/Config_ModuleReader.cpp @@ -172,7 +172,7 @@ void Config_ModuleReader::loadPlugin(const std::string& thePluginName) } } -void Config_ModuleReader::loadScript(const std::string& theFileName) +void Config_ModuleReader::loadScript(const std::string& theFileName, bool theSendErr) { /* acquire python thread */ PyGILState_STATE gstate = PyGILState_Ensure(); @@ -195,7 +195,8 @@ void Config_ModuleReader::loadScript(const std::string& theFileName) Py_XDECREF(pvalue); Py_XDECREF(ptraceback); } - Events_InfoMessage("Config_ModuleReader", anErrorMsg).send(); + if (theSendErr) + Events_InfoMessage("Config_ModuleReader", anErrorMsg).send(); } /* release python thread */ diff --git a/src/Config/Config_ModuleReader.h b/src/Config/Config_ModuleReader.h index 881a10d2d..75aa0f636 100644 --- a/src/Config/Config_ModuleReader.h +++ b/src/Config/Config_ModuleReader.h @@ -49,7 +49,9 @@ class Config_ModuleReader : public Config_XMLReader /// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform CONFIG_EXPORT static void loadLibrary(const std::string& theLibName); /// loads the python module with specified name - CONFIG_EXPORT static void loadScript(const std::string& theFileName); + /// \param theFileName name of the script + /// \param theSendErr send error message in case of faile + CONFIG_EXPORT static void loadScript(const std::string& theFileName, bool theSendErr = true); /*! * Extends set of modules, used for dependency checking (if there is no * required module in the set, a plugin will not be loaded) diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index cbe0e6a52..ee29017f4 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -435,7 +435,7 @@ void Model_Session::LoadPluginsInfo() { if (myPluginsInfoLoaded) // nothing to do return; - Config_ModuleReader::loadScript("salome.shaper.initConfig"); + Config_ModuleReader::loadScript("salome.shaper.initConfig", false); // Read plugins information from XML files Config_ModuleReader aModuleReader(Config_FeatureMessage::MODEL_EVENT()); aModuleReader.readAll();