From: <vo...@us...> - 2008-10-06 20:23:04
|
Revision: 860 http://opde.svn.sourceforge.net/opde/?rev=860&view=rev Author: volca Date: 2008-10-06 19:55:35 +0000 (Mon, 06 Oct 2008) Log Message: ----------- Python bindings fixes, and inherit service bindings added Modified Paths: -------------- trunk/src/bindings/DatabaseServiceBinder.cpp trunk/src/bindings/DatabaseServiceBinder.h trunk/src/bindings/RootBinder.cpp trunk/src/bindings/ServiceBinder.cpp trunk/src/bindings/ServiceBinder.h Added Paths: ----------- trunk/src/bindings/InheritQueryResultBinder.cpp trunk/src/bindings/InheritQueryResultBinder.h trunk/src/bindings/InheritServiceBinder.cpp trunk/src/bindings/InheritServiceBinder.h Modified: trunk/src/bindings/DatabaseServiceBinder.cpp =================================================================== --- trunk/src/bindings/DatabaseServiceBinder.cpp 2008-09-24 20:01:17 UTC (rev 859) +++ trunk/src/bindings/DatabaseServiceBinder.cpp 2008-10-06 19:55:35 UTC (rev 860) @@ -97,6 +97,7 @@ // ------------------------------------------ PyMethodDef DatabaseServiceBinder::msMethods[] = { {"load", load, METH_VARARGS}, + {"loadGameSys", loadGameSys, METH_VARARGS}, {"unload", unload, METH_NOARGS}, {"setProgressListener", setProgressListener, METH_VARARGS}, {"unsetProgressListener", unsetProgressListener, METH_NOARGS}, @@ -129,6 +130,31 @@ } // ------------------------------------------ + PyObject* DatabaseServiceBinder::loadGameSys(PyObject* self, PyObject* args) { + PyObject *result = NULL; + Object* o = python_cast<Object*>(self, &msType); + + const char* fname; + + if (PyArg_ParseTuple(args, "s", &fname)) { + try { + o->mInstance->loadGameSys(fname); + } catch (BasicException& e) { + PyErr_Format(PyExc_IOError, "Exception catched while trying to load gamesys database : %s", e.getDetails().c_str()); + return NULL; + } + + result = Py_None; + Py_INCREF(result); + return result; + } else { + // Invalid parameters + PyErr_SetString(PyExc_TypeError, "Expected a string argument!"); + return NULL; + } + } + + // ------------------------------------------ PyObject* DatabaseServiceBinder::unload(PyObject* self, PyObject* args) { PyObject *result = NULL; Object* o = python_cast<Object*>(self, &msType); Modified: trunk/src/bindings/DatabaseServiceBinder.h =================================================================== --- trunk/src/bindings/DatabaseServiceBinder.h 2008-09-24 20:01:17 UTC (rev 859) +++ trunk/src/bindings/DatabaseServiceBinder.h 2008-10-06 19:55:35 UTC (rev 860) @@ -43,6 +43,7 @@ // --- Methods --- static PyObject* load(PyObject* self, PyObject* args); + static PyObject* loadGameSys(PyObject* self, PyObject* args); static PyObject* unload(PyObject* self, PyObject* args); static PyObject* setProgressListener(PyObject* self, PyObject* args); static PyObject* unsetProgressListener(PyObject* self, PyObject* args); Added: trunk/src/bindings/InheritQueryResultBinder.cpp =================================================================== --- trunk/src/bindings/InheritQueryResultBinder.cpp (rev 0) +++ trunk/src/bindings/InheritQueryResultBinder.cpp 2008-10-06 19:55:35 UTC (rev 860) @@ -0,0 +1,128 @@ +/****************************************************************************** + * + * This file is part of openDarkEngine project + * Copyright (C) 2005-2006 openDarkEngine team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * $Id$ + * + *****************************************************************************/ + +#include "bindings.h" +#include "InheritQueryResultBinder.h" +#include "InheritServiceBinder.h" + +namespace Opde { + + namespace Python { + + // -------------------- Inherit Query result -------------------- + char* InheritQueryResultBinder::msName = "InheritQueryResult"; + + // ------------------------------------------ + PyTypeObject InheritQueryResultBinder::msType = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + msName, /* char *tp_name; */ + sizeof(InheritQueryResultBinder::Object), /* int tp_basicsize; */ + 0, /* int tp_itemsize; /* not used much */ + InheritQueryResultBinder::dealloc, /* destructor tp_dealloc; */ + 0, /* printfunc tp_print; */ + InheritQueryResultBinder::getattr, /* getattrfunc tp_getattr; /* __getattr__ */ + 0, /* setattrfunc tp_setattr; /* __setattr__ */ + 0, /* cmpfunc tp_compare; /* __cmp__ */ + repr, /* reprfunc tp_repr; /* __repr__ */ + 0, /* PyNumberMethods *tp_as_number; */ + 0, /* PySequenceMethods *tp_as_sequence; */ + 0, /* PyMappingMethods *tp_as_mapping; */ + 0, /* hashfunc tp_hash; /* __hash__ */ + 0, /* ternaryfunc tp_call; /* __call__ */ + 0, /* reprfunc tp_str; /* __str__ */ + 0, /* getattrofunc tp_getattro; */ + 0, /* setattrofunc tp_setattro; */ + 0, /* PyBufferProcs *tp_as_buffer; */ + Py_TPFLAGS_DEFAULT, /* long tp_flags; */ + 0, /* char *tp_doc; */ + 0, /* traverseproc tp_traverse; */ + 0, /* inquiry tp_clear; */ + 0, /* richcmpfunc tp_richcompare; */ + 0, /* long tp_weaklistoffset; */ + getIterObject, /* getiterfunc tp_iter; */ + getNext, /* iternextfunc tp_iternext; */ + msMethods, /* struct PyMethodDef *tp_methods; */ + 0, /* struct memberlist *tp_members; */ + 0, /* struct getsetlist *tp_getset; */ + }; + + // ------------------------------------------ + PyMethodDef InheritQueryResultBinder::msMethods[] = { + {NULL, NULL}, + }; + + + // ------------------------------------------ + PyObject* InheritQueryResultBinder::getIterObject(PyObject* self) { + Py_INCREF(self); + return self; + } + + // ------------------------------------------ + PyObject* InheritQueryResultBinder::getNext(PyObject* self) { + Object* o = python_cast<Object*>(self, &msType); + + // Get returnable object, advance to next. + PyObject* next = NULL; + + if ((!o->mInstance.isNull()) && !o->mInstance->end()) { + InheritLinkPtr l = o->mInstance->next(); + next = InheritLinkBinder::create(l); + } + + return next; + } + + // ------------------------------------------ + PyObject* InheritQueryResultBinder::repr(PyObject *self) { + return PyString_FromFormat("<InheritQueryResult at %p>", self); + } + + + // ------------------------------------------ + PyObject* InheritQueryResultBinder::getattr(PyObject *self, char *name) { + return Py_FindMethod(msMethods, self, name); + } + + // ------------------------------------------ + PyObject* InheritQueryResultBinder::create(const InheritQueryResultPtr& result) { + Object* object = construct(&msType); + + if (object != NULL) { + object->mInstance = result; + } + + return (PyObject *)object; + } + + // ------------------------------------------ + void InheritQueryResultBinder::init(PyObject* module) { + publishType(module, &msType, msName); + } + + } + +} // namespace Opde + Property changes on: trunk/src/bindings/InheritQueryResultBinder.cpp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/src/bindings/InheritQueryResultBinder.h =================================================================== --- trunk/src/bindings/InheritQueryResultBinder.h (rev 0) +++ trunk/src/bindings/InheritQueryResultBinder.h 2008-10-06 19:55:35 UTC (rev 860) @@ -0,0 +1,67 @@ +/****************************************************************************** + * + * This file is part of openDarkEngine project + * Copyright (C) 2005-2006 openDarkEngine team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * $Id$ + * + *****************************************************************************/ + +#ifndef __INHERITQUERYRESULYBINDER_H +#define __INHERITQUERYRESULYBINDER_H + +#include "InheritService.h" + +namespace Opde { + + namespace Python { + + /// Inherit query result python binder. Iterable + /// @todo Candidate for a template - Opde::Iterator binder + class InheritQueryResultBinder : public shared_ptr_binder<InheritQueryResultPtr> { + public: + static void init(PyObject* module); + + // --- Python type related methods --- + static PyObject* getattr(PyObject *self, char *name); + + /// to string - reprfunc conversion + static PyObject* repr(PyObject *self); + + /// creates a python object representation of the inherit query result + static PyObject* create(const InheritQueryResultPtr& result); + + protected: + /// Return self as iterator with a increased ref count. + static PyObject* getIterObject(PyObject* self); + /// Returns current object, advances to next object (or returns NULL if at end) + static PyObject* getNext(PyObject* self); + + /// Static type definition for InheritQueryResult + static PyTypeObject msType; + + /// Name of the python type + static char* msName; + + /// Method list + static PyMethodDef msMethods[]; + }; + } +} + +#endif Property changes on: trunk/src/bindings/InheritQueryResultBinder.h ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/src/bindings/InheritServiceBinder.cpp =================================================================== --- trunk/src/bindings/InheritServiceBinder.cpp (rev 0) +++ trunk/src/bindings/InheritServiceBinder.cpp 2008-10-06 19:55:35 UTC (rev 860) @@ -0,0 +1,267 @@ +/****************************************************************************** + * + * This file is part of openDarkEngine project + * Copyright (C) 2005-2006 openDarkEngine team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * $Id$ + * + *****************************************************************************/ + +#include "bindings.h" +#include "InheritServiceBinder.h" +#include "InheritQueryResultBinder.h" + +namespace Opde { + + namespace Python { + + // -------------------- Link Service -------------------- + char* InheritServiceBinder::msName = "InheritService"; + + // ------------------------------------------ + PyTypeObject InheritServiceBinder::msType = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + msName, /* char *tp_name; */ + sizeof(InheritServiceBinder::Object), /* int tp_basicsize; */ + 0, /* int tp_itemsize; // not used much */ + InheritServiceBinder::dealloc, /* destructor tp_dealloc; */ + 0, /* printfunc tp_print; */ + InheritServiceBinder::getattr, /* getattrfunc tp_getattr; // __getattr__ */ + 0, /* setattrfunc tp_setattr; // __setattr__ */ + 0, /* cmpfunc tp_compare; // __cmp__ */ + 0, /* reprfunc tp_repr; // __repr__ */ + 0, /* PyNumberMethods *tp_as_number; */ + 0, /* PySequenceMethods *tp_as_sequence; */ + 0, /* PyMappingMethods *tp_as_mapping; */ + 0, /* hashfunc tp_hash; // __hash__ */ + 0, /* ternaryfunc tp_call; // __call__ */ + 0, /* reprfunc tp_str; // __str__ */ + 0, /* getattrofunc tp_getattro; */ + 0, /* setattrofunc tp_setattro; */ + 0, /* PyBufferProcs *tp_as_buffer; */ + 0, /* long tp_flags; */ + 0, /* char *tp_doc; */ + 0, /* traverseproc tp_traverse; */ + 0, /* inquiry tp_clear; */ + 0, /* richcmpfunc tp_richcompare; */ + 0, /* long tp_weaklistoffset; */ + 0, /* getiterfunc tp_iter; */ + 0, /* iternextfunc tp_iternext; */ + msMethods, /* struct PyMethodDef *tp_methods; */ + 0, /* struct memberlist *tp_members; */ + 0, /* struct getsetlist *tp_getset; */ + }; + + // ------------------------------------------ + PyMethodDef InheritServiceBinder::msMethods[] = { + {"getSources", getSources, METH_VARARGS}, + {"getTargets", getTargets, METH_VARARGS}, + {"getArchetype", getArchetype, METH_VARARGS}, + {"setArchetype", setArchetype, METH_VARARGS}, + {"inheritsFrom", inheritsFrom, METH_VARARGS}, + {NULL, NULL}, + }; + + // ------------------------------------------ + PyObject* InheritServiceBinder::getSources(PyObject* self, PyObject* args) { + PyObject *result = NULL; + Object* o = python_cast<Object*>(self, &msType); + + int objID; + + if (PyArg_ParseTuple(args, "i", &objID)) { + InheritQueryResultPtr res = o->mInstance->getSources(objID); + + result = InheritQueryResultBinder::create(res); + + return result; + } else { + // Invalid parameters + PyErr_SetString(PyExc_TypeError, "Expected one integer argument!"); + return NULL; + } + } + + // ------------------------------------------ + PyObject* InheritServiceBinder::getTargets(PyObject* self, PyObject* args) { + PyObject *result = NULL; + Object* o = python_cast<Object*>(self, &msType); + + int objID; + + if (PyArg_ParseTuple(args, "i", &objID)) { + InheritQueryResultPtr res = o->mInstance->getTargets(objID); + + result = InheritQueryResultBinder::create(res); + + return result; + } else { + // Invalid parameters + PyErr_SetString(PyExc_TypeError, "Expected one integer argument!"); + return NULL; + } + } + + // ------------------------------------------ + PyObject* InheritServiceBinder::getArchetype(PyObject* self, PyObject* args) { + PyObject *result = NULL; + Object* o = python_cast<Object*>(self, &msType); + + int id; + + if (PyArg_ParseTuple(args, "i", &id)) { + int archID = o->mInstance->getArchetype(id); + + result = PyLong_FromLong(archID); + return result; + } else { + // Invalid parameters + PyErr_SetString(PyExc_TypeError, "Expected an integer argument!"); + return NULL; + } + } + + // ------------------------------------------ + PyObject* InheritServiceBinder::setArchetype(PyObject* self, PyObject* args) { + PyObject *result = NULL; + Object* o = python_cast<Object*>(self, &msType); + + int id, srcid; + + if (PyArg_ParseTuple(args, "ii", &id, &srcid)) { + o->mInstance->setArchetype(id, srcid); + + PyObject* result = Py_None; + Py_INCREF(result); + return result; + } else { + // Invalid parameters + PyErr_SetString(PyExc_TypeError, "Expected an integer argument!"); + return NULL; + } + } + + // ------------------------------------------ + PyObject* InheritServiceBinder::inheritsFrom(PyObject* self, PyObject* args) { + PyObject *result = NULL; + Object* o = python_cast<Object*>(self, &msType); + + int id, srcid; + + if (PyArg_ParseTuple(args, "ii", &id, &srcid)) { + bool inh = o->mInstance->inheritsFrom(id, srcid); + + result = inh ? Py_True : Py_False; + Py_INCREF(result); + return result; + } else { + // Invalid parameters + PyErr_SetString(PyExc_TypeError, "Expected an integer argument!"); + return NULL; + } + } + + // ------------------------------------------ + PyObject* InheritServiceBinder::getattr(PyObject *self, char *name) { + return Py_FindMethod(msMethods, self, name); + } + + // ------------------------------------------ + PyObject* InheritServiceBinder::create() { + Object* object = construct(&msType); + + if (object != NULL) { + object->mInstance = static_pointer_cast<InheritService>(ServiceManager::getSingleton().getService(msName)); + } + + return (PyObject *)object; + } + + // ------------------------------------------ + void InheritServiceBinder::init(PyObject* module) { + publishType(module, &msType, msName); + + InheritLinkBinder::init(module); + InheritQueryResultBinder::init(module); + } + + + // -------------------- Link -------------------- + char* InheritLinkBinder::msName = "InheritLink"; + + // ------------------------------------------ + PyTypeObject InheritLinkBinder::msType = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + msName, /* char *tp_name; */ + sizeof(InheritLinkBinder::Object), // int tp_basicsize; */ + 0, /* int tp_itemsize; // not used much */ + InheritLinkBinder::dealloc, /* destructor tp_dealloc; */ + 0, /* printfunc tp_print; */ + InheritLinkBinder::getattr, /* getattrfunc tp_getattr; // __getattr__ */ + }; + + + // ------------------------------------------ + PyObject* InheritLinkBinder::getattr(PyObject *self, char *name) { + Object* o = python_cast<Object*>(self, &msType); + + if (o->mInstance.isNull()) { + // Just return PyNone + PyObject* result = Py_None; + Py_INCREF(result); + return result; + } + + if (strcmp(name, "src") == 0) { + return PyLong_FromLong(o->mInstance->srcID); + } else if (strcmp(name, "dst") == 0) { + return PyLong_FromLong(o->mInstance->dstID); + } else if (strcmp(name, "priority") == 0) { + return PyLong_FromLong(o->mInstance->priority); + } else { + PyErr_SetString(PyExc_TypeError, "Unknown attribute specified!"); + } + + return NULL; + } + + // ------------------------------------------ + PyObject* InheritLinkBinder::create(InheritLinkPtr& link) { + if (link.isNull()) { + PyErr_SetString(PyExc_TypeError, "Null link binding!"); + return NULL; + } + + Object* object = construct(&msType); + + if (object != NULL) { + object->mInstance = link; + } + + return (PyObject *)object; + } + + // ------------------------------------------ + void InheritLinkBinder::init(PyObject* module) { + publishType(module, &msType, msName); + } + } // namespace Python +} // namespace Opde + Property changes on: trunk/src/bindings/InheritServiceBinder.cpp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/src/bindings/InheritServiceBinder.h =================================================================== --- trunk/src/bindings/InheritServiceBinder.h (rev 0) +++ trunk/src/bindings/InheritServiceBinder.h 2008-10-06 19:55:35 UTC (rev 860) @@ -0,0 +1,86 @@ +/****************************************************************************** + * + * This file is part of openDarkEngine project + * Copyright (C) 2005-2006 openDarkEngine team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * $Id$ + * + *****************************************************************************/ + +#ifndef __INHERITSERVICEBINDER_H +#define __INHERITSERVICEBINDER_H + +#include "InheritService.h" + +namespace Opde { + + namespace Python { + + /// Link service python binder + class InheritServiceBinder : public shared_ptr_binder<InheritServicePtr> { + public: + static void init(PyObject* module); + + // --- Python type related methods --- + static PyObject* getattr(PyObject *self, char *name); + + static PyObject* create(); + + // --- Methods --- + static PyObject* getSources(PyObject* self, PyObject* args); + static PyObject* getTargets(PyObject* self, PyObject* args); + static PyObject* getArchetype(PyObject* self, PyObject* args); + static PyObject* setArchetype(PyObject* self, PyObject* args); + // metaprop handling is already binded in ObjectService + static PyObject* inheritsFrom(PyObject* self, PyObject* args); + + + protected: + /// Static type definition for LinkService + static PyTypeObject msType; + + /// Name of the python type + static char* msName; + + /// Method list + static PyMethodDef msMethods[]; + }; + + // ------------------------------- + /// Inherit link struct binder. The attributes are exposed as read only to python + class InheritLinkBinder : public shared_ptr_binder<InheritLinkPtr> { + public: + static void init(PyObject* module); + + // --- Python type related methods --- + static PyObject* getattr(PyObject *self, char *name); + + static PyObject* create(InheritLinkPtr& link); + + protected: + /// Static type definition for LinkService + static PyTypeObject msType; + + /// Name of the python type + static char* msName; + }; + + } +} + +#endif Property changes on: trunk/src/bindings/InheritServiceBinder.h ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/src/bindings/RootBinder.cpp =================================================================== --- trunk/src/bindings/RootBinder.cpp 2008-09-24 20:01:17 UTC (rev 859) +++ trunk/src/bindings/RootBinder.cpp 2008-10-06 19:55:35 UTC (rev 860) @@ -208,16 +208,24 @@ const char *name, *type, *section; PyObject *recursive = Py_False; - if (PyArg_ParseTuple(args, "sss;o", &name, &type, §ion, &recursive)) { - try { - o->mInstance->addResourceLocation(name, type, section, PyBool_Check(recursive)); - } catch (BasicException& e) { - PyErr_Format(PyExc_IOError, "Exception catched while trying to add resource location : %s", e.getDetails().c_str()); - return NULL; - } catch (...) { - PyErr_Format(PyExc_IOError, "Exception catched while trying to add resource location"); - return NULL; - } + if (PyArg_ParseTuple(args, "sss|O", &name, &type, §ion, &recursive)) { + try { + bool recb = false; + if (PyBool_Check(recursive)) { + recb = (recursive == Py_True); + } else { + PyErr_Format(PyExc_TypeError, "The optional argument is expected to be Bool"); + return NULL; + } + + o->mInstance->addResourceLocation(name, type, section, recb); + } catch (BasicException& e) { + PyErr_Format(PyExc_IOError, "Exception catched while trying to add resource location : %s", e.getDetails().c_str()); + return NULL; + } catch (...) { + PyErr_Format(PyExc_IOError, "Exception catched while trying to add resource location"); + return NULL; + } PyObject *result = Py_None; Py_INCREF(result); Modified: trunk/src/bindings/ServiceBinder.cpp =================================================================== --- trunk/src/bindings/ServiceBinder.cpp 2008-09-24 20:01:17 UTC (rev 859) +++ trunk/src/bindings/ServiceBinder.cpp 2008-10-06 19:55:35 UTC (rev 860) @@ -32,6 +32,7 @@ #include "GUIServiceBinder.h" #include "DatabaseServiceBinder.h" #include "ObjectServiceBinder.h" +#include "InheritServiceBinder.h" namespace Opde { namespace Python { @@ -48,6 +49,7 @@ {"getGUIService", getGUIService, METH_NOARGS}, {"getDatabaseService", getDatabaseService, METH_NOARGS}, {"getObjectService", getObjectService, METH_NOARGS}, + {"getInheritService", getInheritService, METH_NOARGS}, {NULL, NULL}, }; @@ -122,6 +124,15 @@ return NULL; } } + + PyObject* ServiceBinder::getInheritService(PyObject* self, PyObject* args) { + try { + return InheritServiceBinder::create(); + } catch (BasicException &e) { + PyErr_Format(PyExc_EnvironmentError, "Exception happened while getting service: %s", e.getDetails().c_str()); + return NULL; + } + } PyObject* ServiceBinder::init(PyObject* container) { PyObject* module = Py_InitModule(msName, msMethods); @@ -140,6 +151,7 @@ LinkServiceBinder::init(module); LoopServiceBinder::init(module); ObjectServiceBinder::init(module); + InheritServiceBinder::init(module); // Publish some service constants PyModule_AddIntConstant(module, "SERVICE_ALL", SERVICE_ALL); Modified: trunk/src/bindings/ServiceBinder.h =================================================================== --- trunk/src/bindings/ServiceBinder.h 2008-09-24 20:01:17 UTC (rev 859) +++ trunk/src/bindings/ServiceBinder.h 2008-10-06 19:55:35 UTC (rev 860) @@ -46,6 +46,7 @@ static PyObject* getGUIService(PyObject* self, PyObject* args); static PyObject* getDatabaseService(PyObject* self, PyObject* args); static PyObject* getObjectService(PyObject* self, PyObject* args); + static PyObject* getInheritService(PyObject* self, PyObject* args); protected: static PyMethodDef msMethods[]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |