Salome HOME
[PYTHON 3] WIP
[modules/yacs.git] / src / evalyfx_swig / evalyfx.i
index 54b5515dd2bb2c99ead50c2b01fbcd53696901e8..6796ada923dc5815e2b5da6d8dbfaa1c822e871c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2015-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -46,7 +46,7 @@ static void convertPyToIntArr(PyObject *pyLi, std::vector<int>& arr)
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyInt_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              int val=(int)PyLong_AS_LONG(o);
               arr[i]=val;
             }
           else
@@ -60,9 +60,9 @@ static void convertPyToIntArr(PyObject *pyLi, std::vector<int>& arr)
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
-          if(PyInt_Check(o))
+          if(PyLong_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              int val=(int)PyLong_AS_LONG(o);
               arr[i]=val;
             }
           else
@@ -80,7 +80,7 @@ static PyObject *convertToPyToInt(const std::vector<unsigned int>& arr)
   std::size_t sz(arr.size());
   PyObject *ret(PyList_New(sz));
   for(std::size_t i=0;i<sz;i++)
-    PyList_SetItem(ret,i,PyInt_FromLong(arr[i]));
+    PyList_SetItem(ret,i,PyLong_FromLong(arr[i]));
   return ret;
 }
 
@@ -148,7 +148,7 @@ static PyObject *convertVectOfSeqAny(const std::vector<YACSEvalSeqAny *>& retCpp
           std::size_t sz2(zeArr->size());
           PyObject *ret2(PyList_New(sz2));
           for(std::size_t i2=0;i2<sz2;i2++)
-            PyList_SetItem(ret2,i2,PyInt_FromLong((*zeArr)[i2]));
+            PyList_SetItem(ret2,i2,PyLong_FromLong((*zeArr)[i2]));
           PyList_SetItem(ret,i,ret2);
         }
       else
@@ -249,7 +249,7 @@ public:
            }
          else if(PyInt_Check(parameter))
            {
-             YACSEvalAnyInt tmp((int)PyInt_AsLong(parameter));
+             YACSEvalAnyInt tmp((int)PyLong_AsLong(parameter));
              self->setDefaultValue(&tmp);
            }
          else
@@ -297,6 +297,8 @@ class YACSEvalOutputPort : public YACSEvalPort
 {
 public:
   std::string getName() const;
+  bool setQOfInterestStatus(bool newStatus);
+  bool isQOfInterest() const;
 private:
   YACSEvalOutputPort();
 };
@@ -344,10 +346,14 @@ public:
   void setExclusiveness(bool newStatus);
   std::string getRemoteWorkingDir();
   void setRemoteWorkingDir(const std::string& remoteWorkingDir);
+  std::string getLocalWorkingDir();
+  void setLocalWorkingDir(const std::string& localWorkingDir);
   std::string getWCKey() const;
   void setWCKey(const std::string& wcKey);
   unsigned int getNbProcs() const;
   void setNbProcs(unsigned int nbProcs);
+  void setMaxDuration(const std::string& maxDuration);
+  std::string getMaxDuration() const;
   void checkConsistency() const;
 private:
   YACSEvalParamsForCluster();
@@ -361,6 +367,7 @@ public:
   void setWantedMachine(const std::string& machine);
   std::size_t size() const;
   bool isInteractive() const;
+  bool isMachineInteractive(const std::string& machine) const;
   YACSEvalResource *at(std::size_t i) const;
   unsigned int getNumberOfProcsDeclared() const;
   void checkOKForRun() const;
@@ -387,6 +394,10 @@ public:
   ~YACSEvalSession();
   void launch();
   bool isLaunched() const;
+  bool isAttached() const;
+  bool isAlreadyPyThreadSaved() const;
+  bool getForcedPyThreadSavedStatus() const;
+  void setForcedPyThreadSavedStatus(bool status);
   void checkLaunched() const;
   int getPort() const;
   std::string getCorbaConfigFileName() const;
@@ -397,6 +408,8 @@ class YACSEvalExecParams
 public:
   bool getStopASAPAfterErrorStatus() const;
   void setStopASAPAfterErrorStatus(bool newStatus);
+  bool getFetchRemoteDirForClusterStatus() const;
+  void setFetchRemoteDirForClusterStatus(bool newStatus);
 private:
   YACSEvalExecParams();
 };
@@ -494,7 +507,7 @@ public:
          PyObject *ret0Py(ret0?Py_True:Py_False);
          Py_XINCREF(ret0Py);
          PyTuple_SetItem(ret,0,ret0Py);
-         PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
+         PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
          return ret;
        }
      }