From: Anthony Geay Date: Tue, 9 Jul 2019 08:47:27 +0000 (+0200) Subject: [EDF19803] : Correction for test15 of testSaveLoadRun.py X-Git-Tag: V9_4_0a1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=649bd3a89287dfeeb755428809347b8eb283c53b;p=modules%2Fkernel.git [EDF19803] : Correction for test15 of testSaveLoadRun.py --- diff --git a/idl/SALOME_Component.idl b/idl/SALOME_Component.idl index a9bc2ef54..38f69a1b8 100644 --- a/idl/SALOME_Component.idl +++ b/idl/SALOME_Component.idl @@ -233,6 +233,8 @@ module Engines */ PyScriptNode createPyScriptNode(in string nodeName, in string code) raises(SALOME::SALOME_Exception); + void removePyScriptNode(in string nodeName) raises(SALOME::SALOME_Exception); + //! Retrieves the last created PyScriptNode instance with createPyScriptNode. PyScriptNode getDefaultPyScriptNode(in string nodeName); diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 7d06ff0ec..12c700ae2 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -1749,6 +1749,21 @@ Engines::PyScriptNode_ptr Engines_Container_i::createPyScriptNode(const char* no } } +void Engines_Container_i::removePyScriptNode(const char *nodeName) +{ + std::map::iterator it(_dftPyScriptNode.find(nodeName)); + if(it==_dftPyScriptNode.end()) + { + std::ostringstream oss; oss << "Engines_Container_i::removePyScriptNode : node \"" << nodeName << "\" is not map !"; + SALOME::ExceptionStruct es; + es.type = SALOME::INTERNAL_ERROR; + es.text = oss.str().c_str(); + throw SALOME::SALOME_Exception(es); + } + (*it).second->UnRegister(); + _dftPyScriptNode.erase(it); +} + void Engines_Container_i::cleanAllPyScripts() { for(std::map::iterator it=_dftPyNode.begin();it!=_dftPyNode.end();it++) diff --git a/src/Container/SALOME_Container_i.hxx b/src/Container/SALOME_Container_i.hxx index 5a68451df..df106658d 100644 --- a/src/Container/SALOME_Container_i.hxx +++ b/src/Container/SALOME_Container_i.hxx @@ -111,7 +111,8 @@ public: Engines::PyNode_ptr createPyNode(const char* nodeName, const char* code); Engines::PyNode_ptr getDefaultPyNode(const char *nodeName); Engines::PyScriptNode_ptr createPyScriptNode(const char* nodeName, const char* code); - void cleanAllPyScripts(); + void removePyScriptNode(const char *nodeName) override; + void cleanAllPyScripts() override; Engines::PyScriptNode_ptr getDefaultPyScriptNode(const char *nodeName); // --- local C++ methods