Salome HOME
PR: swig for file transfer
authorprascle <prascle>
Thu, 20 Apr 2006 21:44:22 +0000 (21:44 +0000)
committerprascle <prascle>
Thu, 20 Apr 2006 21:44:22 +0000 (21:44 +0000)
src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py
src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i

index a03a556be24d4470b88a6bab18682dc320f44060..3d71bf21b4de2853a98d33ed6c1b146f21d1d7c1 100644 (file)
@@ -5,7 +5,9 @@ import os
 import Engines
 import LifeCycleCORBA
 
-host = os.getenv( 'HOST' )
+import Utils_Identity
+host  = Utils_Identity.getShortHostName()
+#host = os.getenv( 'HOST' )
 
 lcc = LifeCycleCORBA.LifeCycleCORBA()
 
index c9f3f0d3ce3466b7a9231407a06c75c6df3613b4..07cca118a35c575ee2c2dd4aef3ed68fab79b1de 100644 (file)
@@ -24,6 +24,7 @@
 %{
 #include "utilities.h"
 #include "SALOME_LifeCycleCORBA.hxx"
+#include "SALOME_FileTransferCORBA.hxx"
 #include "SALOME_NamingService.hxx"
 #include "ServiceUnreachable.hxx"
 
@@ -86,7 +87,7 @@ struct omniORBpyAPI {
 }
 
 
-%typemap(python,out) Engines::Container_ptr, Engines::Component_ptr
+%typemap(python,out) Engines::Container_ptr, Engines::Component_ptr, Engines::fileRef_ptr
 {
   MESSAGE("typemap out on CORBA object ptr");
   SCRUTE($1);
@@ -94,6 +95,13 @@ struct omniORBpyAPI {
   SCRUTE($result);
 }
 
+%typemap(python,out) std::string, 
+                   string
+{
+  MESSAGE("typemap out on std::string");
+  SCRUTE($1);
+  $result = PyString_FromString($1.c_str());
+}
 
 %typemap(typecheck) const Engines::MachineParameters &,
                     Engines::MachineParameters const &
@@ -101,6 +109,31 @@ struct omniORBpyAPI {
   $1 = PyDict_Check($input);
 }
 
+%typemap(typecheck) std::string, 
+                   string
+{
+  $1 = PyString_Check($input);
+}
+
+%typemap(python,in) std::string, 
+                   string
+{
+  MESSAGE("typemap in on std::string");
+  std::string str;
+  if (PyString_Check($input) == 1)
+    {
+      char* value = PyString_AsString($input);
+      str = value;
+      $1 = str;
+    }
+  else 
+    {
+       MESSAGE("Not a string");
+       PyErr_SetString(PyExc_TypeError,"Must Be a Python string");
+       return NULL;
+    }
+}
+
 
 %typemap(python,in) const Engines::MachineParameters &
 {
@@ -174,3 +207,4 @@ struct omniORBpyAPI {
 }
 
 %include "SALOME_LifeCycleCORBA.hxx"
+%include "SALOME_FileTransferCORBA.hxx"