[SCM] Samba Shared Repository - branch master updated - ec80992ef5b54c443e41ebb91e793384907e68ba

Jelmer Vernooij jelmer at samba.org
Sat Dec 20 20:21:02 GMT 2008


The branch, master has been updated
       via  ec80992ef5b54c443e41ebb91e793384907e68ba (commit)
      from  9b16a5ac163025c49b40b7f32f6145da46cd75b8 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ec80992ef5b54c443e41ebb91e793384907e68ba
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Dec 20 21:19:48 2008 +0100

    Fix tevent python module build as part of samba 4.

-----------------------------------------------------------------------

Summary of changes:
 lib/tevent/config.mk  |   10 ++++------
 lib/tevent/pytevent.c |    6 ++++++
 lib/tevent/tests.py   |    6 +++---
 3 files changed, 13 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/config.mk b/lib/tevent/config.mk
index 5f9508a..7654f78 100644
--- a/lib/tevent/config.mk
+++ b/lib/tevent/config.mk
@@ -47,13 +47,11 @@ PUBLIC_HEADERS += $(addprefix $(libteventsrcdir)/, tevent.h tevent_internal.h)
 
 # TODO: Change python stuff to tevent
 [PYTHON::swig_events]
-LIBRARY_REALNAME = samba/_events.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = LIBTEVENT LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL
+LIBRARY_REALNAME = tevent.$(SHLIBEXT)
+PRIVATE_DEPENDENCIES = LIBTEVENT PYTALLOC LIBSAMBA-UTIL
 
-swig_events_OBJ_FILES = $(libteventsrcdir)/events_wrap.o
+swig_events_OBJ_FILES = $(libteventsrcdir)/pytevent.o
 
-$(eval $(call python_py_module_template,samba/events.py,$(libteventsrcdir)/events.py))
-
-$(swig_events_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)
+$(swig_events_OBJ_FILES): CFLAGS+=$(CFLAG_NO_CAST_QUAL)
 
 PC_FILES += $(libteventsrcdir)/tevent.pc
diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c
index b379911..02e0db3 100644
--- a/lib/tevent/pytevent.c
+++ b/lib/tevent/pytevent.c
@@ -103,8 +103,14 @@ void inittevent(void)
 {
     PyObject *m;
 
+    if (PyType_Ready(&PyEventContext) < 0)
+    	return;
+
     m = Py_InitModule3("tevent", tevent_methods, "Event management.");
     if (m == NULL)
         return;
+
+    Py_INCREF(&PyEventContext);
+    PyModule_AddObject(m, "EventContext", (PyObject *)&PyEventContext);
 }
 
diff --git a/lib/tevent/tests.py b/lib/tevent/tests.py
index b14f7e6..0ec736b 100644
--- a/lib/tevent/tests.py
+++ b/lib/tevent/tests.py
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-import events
+import tevent as events
 import unittest
 
 # Just test the bindings are there and that calling them doesn't crash
@@ -25,7 +25,7 @@ import unittest
 
 class EventTestCase(unittest.TestCase):
     def test_create(self):
-        self.assertTrue(events.event() is not None)
+        self.assertTrue(events.EventContext() is not None)
 
     def test_loop_wait(self):
-        self.assertEquals(0, events.event().loop_wait())
+        self.assertEquals(0, events.EventContext().loop_wait())


-- 
Samba Shared Repository


More information about the samba-cvs mailing list