summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-09-04 13:10:56 +0200
committerKarolin Seeger <kseeger@samba.org>2009-09-09 12:45:01 +0200
commitee8bb50d32830138434344f5363ff23fccce016e (patch)
treefb042c1e2b004d1a4e09005333c5355bbb4408b4
parent3405c58d507b14b0be4aadd29d5d4bfa0d67e24c (diff)
downloadsamba-ee8bb50d32830138434344f5363ff23fccce016e.tar.gz
tevent: Remove python module.
This module didn't have any functionality that we actually used yet, and it was quite small. Tevent is quite low level and perhaps doesn't make much sense to expose directly as a Python module. It was also causing build problems when used with a system-tevent. We can always back later if necessary. (cherry picked from commit 5065cf70f8bf41193d6d33413f2285f62bba0502) (cherry picked from commit 1d0e302bc49c77542fa39a18d995268e8685d141)
-rw-r--r--lib/tevent/configure.ac13
-rw-r--r--lib/tevent/pytevent.c143
-rw-r--r--lib/tevent/python.mk5
-rw-r--r--lib/tevent/rules.mk3
-rw-r--r--lib/tevent/tests.py35
-rw-r--r--lib/tevent/tevent.mk20
-rwxr-xr-xsource4/selftest/tests.sh1
7 files changed, 0 insertions, 220 deletions
diff --git a/lib/tevent/configure.ac b/lib/tevent/configure.ac
index 171a4088bac..1c62a700e04 100644
--- a/lib/tevent/configure.ac
+++ b/lib/tevent/configure.ac
@@ -20,18 +20,5 @@ m4_include(pkg.m4)
m4_include(libtalloc.m4)
m4_include(libtevent.m4)
-AC_PATH_PROGS([PYTHON_CONFIG], [python2.6-config python2.5-config python2.4-config python-config])
-AC_PATH_PROGS([PYTHON], [python2.6 python2.5 python2.4 python])
-PYTHON_BUILD_TARGET="build-python"
-PYTHON_INSTALL_TARGET="install-python"
-PYTHON_CHECK_TARGET="check-python"
-AC_SUBST(PYTHON_BUILD_TARGET)
-AC_SUBST(PYTHON_INSTALL_TARGET)
-AC_SUBST(PYTHON_CHECK_TARGET)
-if test -z "$PYTHON_CONFIG"; then
- PYTHON_BUILD_TARGET=""
- PYTHON_INSTALL_TARGET=""
- PYTHON_CHECK_TARGET=""
-fi
AC_OUTPUT(Makefile tevent.pc)
diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c
deleted file mode 100644
index fe7e7e3e382..00000000000
--- a/lib/tevent/pytevent.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008
-
- ** NOTE! The following LGPL license applies to the tevent
- ** library. This does NOT imply that all of Samba is released
- ** under the LGPL
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 3 of the License, or (at your option) any later version.
-
- This library 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
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "replace.h"
-#include <Python.h>
-
-#ifndef Py_RETURN_NONE
-#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
-#endif
-
-#include <tevent.h>
-#include <stdbool.h>
-
-typedef struct {
- PyObject_HEAD
- struct tevent_context *ev_ctx;
-} PyTEventContextObject;
-
-PyAPI_DATA(PyTypeObject) PyTEventContext;
-
-static PyObject *py_set_default_backend(PyObject *self, PyObject *args)
-{
- char *name;
-
- if (!PyArg_ParseTuple(args, "s", &name))
- return NULL;
- tevent_set_default_backend(name);
- Py_RETURN_NONE;
-}
-
-static PyObject *py_backend_list(PyObject *self)
-{
- const char **backends = tevent_backend_list(NULL);
- PyObject *ret;
- int i, len;
-
- for (len = 0; backends[len]; len++);
-
- ret = PyList_New(len);
- for (i = 0; i < len; i++)
- PyList_SetItem(ret, i, PyString_FromString(backends[i]));
- talloc_free(backends);
-
- return ret;
-}
-
-static PyMethodDef tevent_methods[] = {
- { "set_default_backend", (PyCFunction)py_set_default_backend,
- METH_VARARGS, "set_default_backend(name) -> None" },
- { "backend_list", (PyCFunction)py_backend_list,
- METH_NOARGS, "backend_list() -> list" },
- { NULL },
-};
-
-static PyObject *py_event_ctx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
-{
- const char *kwnames[] = { "name", NULL };
- char *name = NULL;
- struct tevent_context *ev_ctx;
- PyTEventContextObject *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|s",
- discard_const_p(char *, kwnames),
- &name))
- return NULL;
-
- if (name == NULL)
- ev_ctx = tevent_context_init(NULL);
- else
- ev_ctx = tevent_context_init_byname(NULL, name);
-
- ret = (PyTEventContextObject *)type->tp_alloc(type, 0);
- ret->ev_ctx = ev_ctx;
- return (PyObject *)ret;
-}
-
-static PyObject *py_event_ctx_loop_once(PyTEventContextObject *self)
-{
- return PyInt_FromLong(tevent_loop_once(self->ev_ctx));
-}
-
-static PyObject *py_event_ctx_loop_wait(PyTEventContextObject *self)
-{
- return PyInt_FromLong(tevent_loop_wait(self->ev_ctx));
-}
-
-static PyMethodDef py_event_ctx_methods[] = {
- { "loop_once", (PyCFunction)py_event_ctx_loop_once, METH_NOARGS,
- "S.loop_once() -> int" },
- { "loop_wait", (PyCFunction)py_event_ctx_loop_wait, METH_NOARGS,
- "S.loop_wait() -> int" },
- { NULL }
-};
-
-static void py_event_ctx_dealloc(PyTEventContextObject * self)
-{
- talloc_free(self->ev_ctx);
- self->ob_type->tp_free(self);
-}
-
-
-PyTypeObject PyTEventContext = {
- .tp_name = "TEventContext",
- .tp_methods = py_event_ctx_methods,
- .tp_basicsize = sizeof(PyTEventContextObject),
- .tp_dealloc = (destructor)py_event_ctx_dealloc,
- .tp_flags = Py_TPFLAGS_DEFAULT,
- .tp_new = py_event_ctx_new,
-};
-
-void inittevent(void)
-{
- PyObject *m;
-
- if (PyType_Ready(&PyTEventContext) < 0)
- return;
-
- m = Py_InitModule3("tevent", tevent_methods, "Event management.");
- if (m == NULL)
- return;
-
- Py_INCREF(&PyTEventContext);
- PyModule_AddObject(m, "TEventContext", (PyObject *)&PyTEventContext);
-}
-
diff --git a/lib/tevent/python.mk b/lib/tevent/python.mk
deleted file mode 100644
index 0c1beca6759..00000000000
--- a/lib/tevent/python.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-[PYTHON::pytevent]
-LIBRARY_REALNAME = tevent.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = LIBTEVENT PYTALLOC LIBSAMBA-UTIL LIBREPLACE
-
-pytevent_OBJ_FILES = $(libteventsrcdir)/pytevent.o
diff --git a/lib/tevent/rules.mk b/lib/tevent/rules.mk
index 6fd990fbf4e..28a2515b01b 100644
--- a/lib/tevent/rules.mk
+++ b/lib/tevent/rules.mk
@@ -1,8 +1,5 @@
.SUFFIXES: .i _wrap.c
-.i_wrap.c:
- $(SWIG) -O -Wall -python -keyword $<
-
showflags::
@echo 'libtevent will be compiled with flags:'
@echo ' CFLAGS = $(CFLAGS)'
diff --git a/lib/tevent/tests.py b/lib/tevent/tests.py
deleted file mode 100644
index 53e00b03c64..00000000000
--- a/lib/tevent/tests.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/python
-
-# Unix SMB/CIFS implementation.
-# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
-#
-# ** NOTE! The following LGPL license applies to the tevent
-# ** library. This does NOT imply that all of Samba is released
-# ** under the LGPL
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, see <http://www.gnu.org/licenses/>.
-#
-
-import tevent
-import unittest
-
-# Just test the bindings are there and that calling them doesn't crash
-# anything.
-
-class TEventTestCase(unittest.TestCase):
- def test_create(self):
- self.assertTrue(tevent.TEventContext() is not None)
-
- def test_loop_wait(self):
- self.assertEquals(0, tevent.TEventContext().loop_wait())
diff --git a/lib/tevent/tevent.mk b/lib/tevent/tevent.mk
index ff01bd9808d..82cc4a0860b 100644
--- a/lib/tevent/tevent.mk
+++ b/lib/tevent/tevent.mk
@@ -33,23 +33,3 @@ install:: all installdirs installheaders installlibs $(PYTHON_INSTALL_TARGET)
clean::
rm -f $(TEVENT_SOBASE) $(TEVENT_SONAME) $(TEVENT_SOLIB) $(TEVENT_STLIB)
rm -f tevent.pc
- rm -f tevent.$(SHLIBEXT)
-
-#python stuff
-
-check-python:: build-python
- $(LIB_PATH_VAR)=. PYTHONPATH=".:$(teventdir)" $(PYTHON) $(teventdir)/tests.py
-
-build-python:: tevent.$(SHLIBEXT)
-
-pytevent.o: $(teventdir)/pytevent.c
- $(CC) $(PICFLAG) -c $(teventdir)/pytevent.c $(CFLAGS) `$(PYTHON_CONFIG) --cflags`
-
-tevent.$(SHLIBEXT): $(TEVENT_SOBASE) $(TEVENT_SONAME) pytevent.o
- $(SHLD) $(SHLD_FLAGS) -o $@ pytevent.o -L. -ltevent `$(PYTHON_CONFIG) --libs`
-
-install-python:: build-python
- mkdir -p $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(0, prefix='$(prefix)')"` \
- $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
- cp tevent.$(SHLIBEXT) $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
-
diff --git a/source4/selftest/tests.sh b/source4/selftest/tests.sh
index 821db064146..92ac1041253 100755
--- a/source4/selftest/tests.sh
+++ b/source4/selftest/tests.sh
@@ -415,7 +415,6 @@ plantest "samr.python" dc:local $SUBUNITRUN samba.tests.dcerpc.sam
plantest "dcerpc.bare.python" dc:local $SUBUNITRUN samba.tests.dcerpc.bare
plantest "unixinfo.python" dc:local $SUBUNITRUN samba.tests.dcerpc.unix
plantest "samdb.python" none $SUBUNITRUN samba.tests.samdb
-plantest "tevent.python" none PYTHONPATH="$PYTHONPATH:../lib/tevent" $SUBUNITRUN tests
plantest "messaging.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/lib/messaging/tests" $SUBUNITRUN bindings
plantest "samba3sam.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/dsdb/samdb/ldb_modules/tests" $SUBUNITRUN samba3sam
plantest "subunit.python" none $SUBUNITRUN subunit