aPyFunc += "import sys\n" ;
aPyFunc += "import CORBA\n" ;
aPyFunc += "import omniORB\n" ;
+ aPyFunc += "orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
aPyFunc += "def PyObjRef( IORObjStr ) :\n" ;
- aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
+ // aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
aPyFunc += " objref = orb.string_to_object( IORObjStr )\n" ;
aPyFunc += " return objref\n" ;
aPyFunc += "InitPyRunMethod.RunMethod( PyObjRef )\n" ;
aPyFunc += "import sys\n" ;
aPyFunc += "import CORBA\n" ;
aPyFunc += "import omniORB\n" ;
+ aPyFunc += "orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
aPyFunc += "def PyObjIor( ObjRef ) :\n" ;
- aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
+ // aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
aPyFunc += " objIor = orb.object_to_string( ObjRef )\n" ;
aPyFunc += " return objIor\n" ;
aPyFunc += "InitPyRunMethod.RunMethod( PyObjIor )\n" ;
PyObject * ArgsList = NULL ;
PyObject * ArgValue = NULL ;
PyObject * Result = NULL ;
- PyObject * MyPyObjRefList = NULL ;
+ //PyObject * MyPyObjRefList = NULL ;
PyObject * ResultObj = NULL ;
- PyObject * MyPyObjIorList = NULL ;
+ //PyObject * MyPyObjIorList = NULL ;
PyObject * ResultIor = NULL ;
CORBA::Object_ptr ObjRef ;
break ;
}
case CORBA::tk_objref : {
- MyPyObjRefList = PyTuple_New( 1 ) ;
- PyObject * ObjValue ;
+ //MyPyObjRefList = PyTuple_New( 1 ) ;
+ //PyObject * ObjValue ;
#if OMNIORB_VERSION >= 4
data >>= (CORBA::Any::to_object ) ObjRef ;
#else
data >>= ObjRef ;
#endif
IORObjRef = ObjectToString( ObjRef ) ;
- ObjValue = Py_BuildValue( "s" , IORObjRef ) ;
- PyTuple_SetItem( MyPyObjRefList , 0 , ObjValue ) ;
- cdebug << "ArgIn" << i << " : " << sname << " " << method << " " << " Value " << IORObjRef << " (objref) "
- << MyPyObjRef->ob_refcnt << "/" << MyPyObjRefList->ob_refcnt << endl ;
+ //ObjValue = Py_BuildValue( "s" , IORObjRef ) ;
+ //PyTuple_SetItem( MyPyObjRefList , 0 , ObjValue ) ;
+ //cdebug << "ArgIn" << i << " : " << sname << " " << method << " " << " Value " << IORObjRef << " (objref) "
+ // << MyPyObjRef->ob_refcnt << "/" << MyPyObjRefList->ob_refcnt << endl ;
// ResultObj = PyEval_CallObject( MyPyObjRef , MyPyObjRefList ) ;
- ResultObj = PyEvalCallObject( MyPyObjRef , MyPyObjRefList ) ;
- cdebug << "ObjValue->ob_refcnt" << ObjValue->ob_refcnt << endl ;
- ArgValue = Py_BuildValue( "O" , ResultObj ) ;
- PyTuple_SetItem( ArgsList , i , ArgValue ) ;
+ //ResultObj = PyEvalCallObject( MyPyObjRef , MyPyObjRefList ) ;
+ //cdebug << "ObjValue->ob_refcnt" << ObjValue->ob_refcnt << endl ;
+ //ArgValue = Py_BuildValue( "O" , ResultObj ) ;
+ //PyTuple_SetItem( ArgsList , i , ArgValue ) ;
+ cdebug << "ArgIn" << i << " : " << sname << " " << method << " " << " Value " << IORObjRef << " (objref) "<<endl;
+ ResultObj = PyObject_CallFunction( MyPyObjRef , "s",IORObjRef ) ;
+ if(ResultObj == NULL){
+ PyErr_Print();
+ ResultObj=Py_None;
+ Py_INCREF(ResultObj) ;
+ }
+ PyTuple_SetItem( ArgsList , i , ResultObj ) ;
cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt"
- << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
- cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ;
- Py_DECREF( MyPyObjRefList ) ;
- if ( CORBA::is_nil( ObjRef ) ) {
- ResultObj = NULL ;
- }
- else {
- cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
- Py_DECREF( ResultObj ) ;
- }
+ << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ResultObj->ob_refcnt << endl ;
+ // << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
+ //cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ;
+ //Py_DECREF( MyPyObjRefList ) ;
+ //if ( CORBA::is_nil( ObjRef ) ) {
+ // ResultObj = NULL ;
+ //}
+ //else {
+ // cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
+ // Py_DECREF( ResultObj ) ;
+ //}
break ;
}
default : {
if ( Result == NULL ) {
cdebug_out << "GraphExecutor::InNode::PyDynInvoke Node " << Name() << " " << method << " Error Result == NULL"
<< endl ;
+ PyErr_Print();
RetVal = false ;
}
else {
}
case CORBA::tk_objref : {
PyObject * ObjIor ;
- MyPyObjIorList = PyTuple_New( 1 ) ;
+ //MyPyObjIorList = PyTuple_New( 1 ) ;
if ( PyTuple_Check( Result ) ) {
ObjIor = PyTuple_GetItem( Result , i ) ;
}
cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << "(object reference) "
<< " ArgsList->ob_refcnt" << ArgsList->ob_refcnt << " ObjIor->ob_refcnt"
<< ObjIor->ob_refcnt << endl ;
- Py_INCREF( ObjIor ) ;
+ //Py_INCREF( ObjIor ) ;
// PyObject_Print( ObjIor , stdout , 0 ) ;
- PyTuple_SetItem( MyPyObjIorList , 0 , ObjIor ) ;
+ //PyTuple_SetItem( MyPyObjIorList , 0 , ObjIor ) ;
// ResultIor = PyEval_CallObject( MyPyObjIor , MyPyObjIorList ) ;
- ResultIor = PyEvalCallObject( MyPyObjIor , MyPyObjIorList ) ;
+ //ResultIor = PyEvalCallObject( MyPyObjIor , MyPyObjIorList ) ;
+ ResultIor = PyObject_CallFunction( MyPyObjIor , "O",ObjIor ) ;
+
cdebug << "ObjIor->ob_refcnt " << ObjIor->ob_refcnt-1 << endl ;
- Py_DECREF( ObjIor ) ;
- cdebug << "MyPyObjIorList->ob_refcnt " << MyPyObjIorList->ob_refcnt-1 << endl ;
- Py_DECREF( MyPyObjIorList ) ;
- cdebug << "MyPyObjIor->ob_refcnt " << MyPyObjIor->ob_refcnt << endl ;
+ //Py_DECREF( ObjIor ) ;
+ //cdebug << "MyPyObjIorList->ob_refcnt " << MyPyObjIorList->ob_refcnt-1 << endl ;
+ //Py_DECREF( MyPyObjIorList ) ;
+ //cdebug << "MyPyObjIor->ob_refcnt " << MyPyObjIor->ob_refcnt << endl ;
if ( ResultIor ) {
char * IOR = NULL ;
IOR = PyString_AsString( ResultIor ) ;
ObjRef = StringToObject( IOR ) ;
data <<= ObjRef ;
- IORObjRef = ObjectToString( ObjRef ) ;
- cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << IORObjRef << " (objref) "
+ //IORObjRef = ObjectToString( ObjRef ) ;
+ //cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << IORObjRef << " (objref) "
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << IOR << " (objref) "
<< endl ;
- if ( CORBA::is_nil( ObjRef ) ) {
- ResultIor = NULL ;
- }
- else {
- cdebug << "ResultIor->ob_refcnt " << ResultIor->ob_refcnt-1 << endl ;
- Py_DECREF( ResultIor ) ;
- }
+ //if ( CORBA::is_nil( ObjRef ) ) {
+ // ResultIor = NULL ;
+ //}
+ //else {
+ // cdebug << "ResultIor->ob_refcnt " << ResultIor->ob_refcnt-1 << endl ;
+ // Py_DECREF( ResultIor ) ;
+ //}
}
+ cdebug << "ResultIor->ob_refcnt " << ResultIor->ob_refcnt-1 << endl ;
+ Py_DECREF( ResultIor ) ;
+
+ cdebug << "ObjIor->ob_refcnt " << ObjIor->ob_refcnt-1 << endl ;
else {
+ PyErr_Print();
cdebug_out << "GraphExecutor::InNode::PyDynInvoke Error ResultIor == NULL Node "
<< Name() << " method " << method << " " << endl ;
RetVal = false ;
Py_DECREF( ArgsList ) ;
}
+ fflush(stdout);
+ fflush(stderr);
+
cdebug_out << "GraphExecutor::InNode::PyDynInvoke Node " << Name() << " method " << method << " " << RetVal
<< endl ;