[wpdev-commits] wolfpack/python gump.h,1.9,1.10 item.cpp,1.77,1.78
Brought to you by:
rip,
thiagocorrea
|
From: <thi...@us...> - 2004-01-12 04:58:18
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv23531
Modified Files:
gump.h item.cpp
Log Message:
fixed item.settag() from python script interface. This will fix books and maybe several other thing
Index: gump.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/gump.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** gump.h 10 Jun 2003 00:55:24 -0000 1.9
--- gump.h 12 Jan 2004 04:58:15 -0000 1.10
***************
*** 93,97 ****
};
! PyObject *PyGetGumpResponse( gumpChoice_st &response )
{
wpGumpResponse *returnVal = PyObject_New( wpGumpResponse, &wpGumpResponseType );
--- 93,97 ----
};
! PyObject *PyGetGumpResponse( const gumpChoice_st &response )
{
wpGumpResponse *returnVal = PyObject_New( wpGumpResponse, &wpGumpResponseType );
***************
*** 120,124 ****
}
! void handleResponse( cUOSocket* socket, gumpChoice_st choice )
{
// Call the response function (and pass it a response-object)
--- 120,124 ----
}
! void handleResponse( cUOSocket* socket, const gumpChoice_st& choice )
{
// Call the response function (and pass it a response-object)
Index: item.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** item.cpp 30 Sep 2003 15:06:30 -0000 1.77
--- item.cpp 12 Jan 2004 04:58:15 -0000 1.78
***************
*** 369,386 ****
return PyFalse;
! if( PyTuple_Size( args ) < 1 || !checkArgStr( 0 ) || ( !checkArgStr( 1 ) && !checkArgInt( 1 ) ) )
{
! PyErr_BadArgument();
! return NULL;
}
!
! QString key = PyString_AsString( PyTuple_GetItem( args, 0 ) );
self->pItem->removeTag( key );
! if( checkArgStr( 1 ) )
! self->pItem->setTag( key, cVariant( QString( getArgStr( 1 ) ) ) );
! else if( checkArgInt( 1 ) )
! self->pItem->setTag( key, cVariant( (int)getArgInt( 1 ) ) );
return PyTrue;
--- 369,390 ----
return PyFalse;
! char* pKey = 0, *pTag = 0;
! int iTag;
! cVariant tag;
! if( PyArg_ParseTuple( args, "ss:item.settag( key, tag )", &pKey, &pTag ) )
{
! tag = cVariant( QString( pTag ) );
}
! else if ( PyArg_ParseTuple( args, "si:item.settag( key, tag )", &pKey, &iTag ) )
! {
! tag = cVariant( iTag );
! }else
! return 0;
!
! QString key = pKey;
self->pItem->removeTag( key );
! self->pItem->setTag( key, tag );
return PyTrue;
***************
*** 395,405 ****
return PyFalse;
! if( PyTuple_Size( args ) < 1 || !checkArgStr( 0 ) )
! {
! PyErr_BadArgument();
! return NULL;
! }
! QString key = PyString_AsString( PyTuple_GetItem( args, 0 ) );
return self->pItem->getTag( key ).isValid() ? PyTrue : PyFalse;
--- 399,407 ----
return PyFalse;
! char* pKey = 0;
! if ( !PyArg_ParseTuple( args, "s:item.hastag( key )", &pKey ) )
! return 0;
! QString key = pKey;
return self->pItem->getTag( key ).isValid() ? PyTrue : PyFalse;
|