From: Florian Festi Date: Thu, 26 Mar 2009 10:48:09 +0000 (+0100) Subject: Remove rpmal from the Python API X-Git-Tag: rpm-4.8.0-beta1~553 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ce328aa29a7f32dde2e831856bf46efb9e50df1;p=platform%2Fupstream%2Frpm.git Remove rpmal from the Python API as it changed and never was usable anyway --- diff --git a/python/Makefile.am b/python/Makefile.am index 5ce7e4c..0df57b2 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -20,7 +20,6 @@ _rpmmodule_la_LIBADD = \ _rpmmodule_la_SOURCES = rpmmodule.c system.h \ header-py.c header-py.h \ - rpmal-py.c rpmal-py.h \ rpmds-py.c rpmds-py.h \ rpmdb-py.c rpmdb-py.h \ rpmfd-py.c rpmfd-py.h \ diff --git a/python/rpmal-py.c b/python/rpmal-py.c deleted file mode 100644 index c503202..0000000 --- a/python/rpmal-py.c +++ /dev/null @@ -1,160 +0,0 @@ -/** \ingroup py_c - * \file python/rpmal-py.c - */ - -#include "system.h" - -#include "rpmal-py.h" -#include "rpmds-py.h" -#include "rpmfi-py.h" - -#include "debug.h" - -static PyObject * -rpmal_Debug(rpmalObject * s, PyObject * args, PyObject * kwds) -{ - char * kwlist[] = {"debugLevel", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &_rpmal_debug)) - return NULL; - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject * -rpmal_Add(rpmalObject * s, PyObject * args, PyObject * kwds) -{ - rpmte p; - char * kwlist[] = {"package", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:Add", kwlist, - &p)) - return NULL; - - rpmalAdd(s->al, p); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject * -rpmal_Del(rpmalObject * s, PyObject * args, PyObject * kwds) -{ - rpmte p; - char * kwlist[] = {"key", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:Del", kwlist, &p)) - return NULL; - - rpmalDel(s->al, p); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject * -rpmal_MakeIndex(rpmalObject * s) -{ - rpmalMakeIndex(s->al); - - Py_INCREF(Py_None); - return Py_None; -} - -static struct PyMethodDef rpmal_methods[] = { - {"Debug", (PyCFunction)rpmal_Debug, METH_VARARGS|METH_KEYWORDS, - NULL}, - {"add", (PyCFunction)rpmal_Add, METH_VARARGS|METH_KEYWORDS, - NULL}, - {"delete", (PyCFunction)rpmal_Del, METH_VARARGS|METH_KEYWORDS, - NULL}, - {"makeIndex",(PyCFunction)rpmal_MakeIndex, METH_NOARGS, - NULL}, - {NULL, NULL } /* sentinel */ -}; - -/* ---------- */ - -static void -rpmal_dealloc(rpmalObject * s) -{ - if (s) { - s->al = rpmalFree(s->al); - PyObject_Del(s); - } -} - -static PyObject * rpmal_getattro(PyObject * o, PyObject * n) -{ - return PyObject_GenericGetAttr(o, n); -} - -static int rpmal_setattro(PyObject * o, PyObject * n, PyObject * v) -{ - return PyObject_GenericSetAttr(o, n, v); -} - -/** - */ -static char rpmal_doc[] = -""; - -PyTypeObject rpmal_Type = { - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ - "rpm.al", /* tp_name */ - sizeof(rpmalObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor) rpmal_dealloc, /* tp_dealloc */ - (printfunc)0, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ - (cmpfunc)0, /* tp_compare */ - (reprfunc)0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)0, /* tp_str */ - (getattrofunc) rpmal_getattro, /* tp_getattro */ - (setattrofunc) rpmal_setattro, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - rpmal_doc, /* tp_doc */ -#if Py_TPFLAGS_HAVE_ITER - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)0, /* tp_iter */ - (iternextfunc)0, /* tp_iternext */ - rpmal_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ -#endif -}; - -/* ---------- */ - -rpmalObject * -rpmal_Wrap(rpmal al) -{ - rpmalObject *s = PyObject_New(rpmalObject, &rpmal_Type); - if (s == NULL) - return NULL; - s->al = al; - return s; -} diff --git a/python/rpmal-py.h b/python/rpmal-py.h deleted file mode 100644 index 810c5ed..0000000 --- a/python/rpmal-py.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef H_RPMAL_PY -#define H_RPMAL_PY - -#include - -/** \ingroup py_c - * \file python/rpmal-py.h - */ - -typedef struct rpmalObject_s { - PyObject_HEAD - PyObject *md_dict; /*!< to look like PyModuleObject */ - rpmal al; -} rpmalObject; - -extern PyTypeObject rpmal_Type; - -rpmalObject * rpmal_Wrap(rpmal al); - -#endif diff --git a/python/rpmdebug-py.c b/python/rpmdebug-py.c index fbfc0bf..be35ecb 100644 --- a/python/rpmdebug-py.c +++ b/python/rpmdebug-py.c @@ -4,7 +4,6 @@ extern PyTypeObject PyDictIter_Type; extern PyTypeObject PyFrame_Type; #include "header-py.h" /* XXX debug only */ -#include "rpmal-py.h" /* XXX debug only */ #include "rpmds-py.h" /* XXX debug only */ #include "rpmfd-py.h" /* XXX debug only */ #include "rpmfi-py.h" /* XXX debug only */ @@ -64,7 +63,6 @@ static const char * lbl(void * s) if (o->ob_type == &PyUnicode_Type) return "Unicode"; if (o->ob_type == &hdr_Type) return "hdr"; - if (o->ob_type == &rpmal_Type) return "rpmal"; if (o->ob_type == &rpmds_Type) return "rpmds"; if (o->ob_type == &rpmfd_Type) return "rpmfd"; if (o->ob_type == &rpmfi_Type) return "rpmfi"; diff --git a/python/rpmmodule.c b/python/rpmmodule.c index 29240fc..77b1c14 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -11,7 +11,6 @@ #include #include "header-py.h" -#include "rpmal-py.h" #include "rpmds-py.h" #include "rpmfd-py.h" #include "rpmfi-py.h" @@ -237,7 +236,6 @@ void init_rpm(void) #if Py_TPFLAGS_HAVE_ITER /* XXX backport to python-1.5.2 */ if (PyType_Ready(&hdr_Type) < 0) return; - if (PyType_Ready(&rpmal_Type) < 0) return; if (PyType_Ready(&rpmds_Type) < 0) return; if (PyType_Ready(&rpmfd_Type) < 0) return; if (PyType_Ready(&rpmfi_Type) < 0) return; @@ -278,9 +276,6 @@ void init_rpm(void) Py_INCREF(&hdr_Type); PyModule_AddObject(m, "hdr", (PyObject *) &hdr_Type); - Py_INCREF(&rpmal_Type); - PyModule_AddObject(m, "al", (PyObject *) &rpmal_Type); - Py_INCREF(&rpmds_Type); PyModule_AddObject(m, "ds", (PyObject *) &rpmds_Type); @@ -306,7 +301,6 @@ void init_rpm(void) PyModule_AddObject(m, "spec", (PyObject *) &spec_Type); #else hdr_Type.ob_type = &PyType_Type; - rpmal_Type.ob_type = &PyType_Type; rpmds_Type.ob_type = &PyType_Type; rpmfd_Type.ob_type = &PyType_Type; rpmfi_Type.ob_type = &PyType_Type;