From e6eb7b5307da2a446e1c8c6b0cb6b11fc6705b00 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 18 Dec 2006 20:33:56 +0000 Subject: Switch to autotools and test with Python 2.5 as well as 2.4. In the process: HACKING.txt: update include/dbus-python.h: add some typedefs to make it saner bus.c, conn.c, conn-methods.c: further alter docstrings to keep epydoc happy exceptions.c: create exceptions in a more longwinded way for Python 2.5 compatibility message-get-args.c, bus/__init__.py: tweak docstrings dbus/introspect_parser.py: make docstring valid reStructuredText run-test.sh: simplify, since configure now does some of the work test/*.py: use paths from run-test.sh, cope with out-of-tree builds test-standalone.py: carry out additional sanity checks --- _dbus_bindings/module.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to '_dbus_bindings/module.c') diff --git a/_dbus_bindings/module.c b/_dbus_bindings/module.c index 3e0e932..616579c 100644 --- a/_dbus_bindings/module.c +++ b/_dbus_bindings/module.c @@ -21,6 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#include "config.h" #include #include @@ -237,11 +238,11 @@ init_dbus_bindings(void) { PyObject *this_module, *c_api; static const int API_count = DBUS_BINDINGS_API_COUNT; - static void *dbus_bindings_API[DBUS_BINDINGS_API_COUNT]; + static _dbus_py_func_ptr dbus_bindings_API[DBUS_BINDINGS_API_COUNT]; - dbus_bindings_API[0] = (void *)&API_count; - dbus_bindings_API[1] = (void *)Connection_BorrowDBusConnection; - dbus_bindings_API[2] = (void *)NativeMainLoop_New4; + dbus_bindings_API[0] = (_dbus_py_func_ptr)&API_count; + dbus_bindings_API[1] = (_dbus_py_func_ptr)DBusPyConnection_BorrowDBusConnection; + dbus_bindings_API[2] = (_dbus_py_func_ptr)DBusPyNativeMainLoop_New4; default_main_loop = NULL; @@ -354,6 +355,12 @@ init_dbus_bindings(void) if (PyModule_AddStringConstant(this_module, "__docformat__", "restructuredtext") < 0) return; + if (PyModule_AddStringConstant(this_module, "__version__", + PACKAGE_VERSION) < 0) return; + + if (PyModule_AddIntConstant(this_module, "_python_version", + PY_VERSION_HEX) < 0) return; + c_api = PyCObject_FromVoidPtr ((void *)dbus_bindings_API, NULL); if (!c_api) { return; -- cgit v1.2.1