Salome HOME
Add a global result for a study.
[tools/ydefx.git] / src / cpp / TMonoPyJob.hxx
index ce0741c98cba8434695f7b5a73bf63bf3d1f4379..54bc43f17bb57f12d46b55ac68eeebcf9e894fc5 100644 (file)
 #define YDEFX_TMONOPYJOB_HXX
 #include "JobParametersProxy.hxx"
 #include "MonoPyJob.hxx"
-#include "Sample.hxx"
 #include "SamplePyConversions.hxx"
 #include "PyStudyFunction.hxx"
-#include <py2cpp/py2cpp.hxx>
 
 namespace ydefx
 {
@@ -38,14 +36,14 @@ public:
   : MonoPyJob()
   , _sample(sample)
   {
-    if(_lastError.empty()) // no errors during parent contruction
+    if(_lastError.empty()) // no errors during parent construction
     {
       try
       {
         py2cpp::PyPtr pySample = createPySample(sample);
         py2cpp::PyFunction pyFn;
         pyFn.loadExp(_pyStudy, "createNewJob");
-        pyFn(fnScript.content(), pySample, params);
+        pyFn(fnScript, pySample, params);
       }
       catch(std::exception& e)
       {
@@ -60,7 +58,7 @@ public:
   : MonoPyJob()
   , _sample(sample)
   {
-    if(_lastError.empty()) // no errors during parent contruction
+    if(_lastError.empty()) // no errors during parent construction
     {
       try
       {
@@ -84,6 +82,7 @@ public:
     {
       py2cpp::PyFunction pyFn;
       pyFn.loadExp(_pyStudy, "getResult");
+      pyFn(); // python call: _pyStudy.getResult()
       fetchResults(_pyStudy.getAttr("sample"), _sample);
     }
     catch(std::exception& e)