]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
[EDF19803] : Correction for test15 of testSaveLoadRun.py
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 9 Jul 2019 08:47:27 +0000 (10:47 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 9 Jul 2019 08:47:27 +0000 (10:47 +0200)
idl/SALOME_Component.idl
src/Container/Container_i.cxx
src/Container/SALOME_Container_i.hxx

index a9bc2ef548630b8a1abe8641cadaa203c25acf66..38f69a1b8e428c33771eda5d6eda5fb18bf2d74c 100644 (file)
@@ -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);
 
index 7d06ff0ec32ef4a9cf2f262dce90e88c9b5a3d1b..12c700ae276b64401f52d1b81f54656e18726efc 100644 (file)
@@ -1749,6 +1749,21 @@ Engines::PyScriptNode_ptr Engines_Container_i::createPyScriptNode(const char* no
   }
 }
 
+void Engines_Container_i::removePyScriptNode(const char *nodeName)
+{
+  std::map<std::string,Engines::PyScriptNode_var>::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<std::string,Engines::PyNode_var>::iterator it=_dftPyNode.begin();it!=_dftPyNode.end();it++)
index 5a68451dffd9573283e66dbaf2a91b318eca4a8b..df106658d047c53c3cc3cf0a1e96b4eef9092e15 100644 (file)
@@ -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