summaryrefslogtreecommitdiff
path: root/python/rpmmi-py.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-08-09 23:14:10 +0000
committerjbj <devnull@localhost>2002-08-09 23:14:10 +0000
commit644401875d02f4fad5e8e5a004aa9bd08153ba84 (patch)
tree101f1c7fb467f95f72b171c024b942afe3e238c7 /python/rpmmi-py.c
parent7937158c01c71774eb5872f742a9d9c771df5b79 (diff)
downloadlibrpm-tizen-644401875d02f4fad5e8e5a004aa9bd08153ba84.tar.gz
librpm-tizen-644401875d02f4fad5e8e5a004aa9bd08153ba84.tar.bz2
librpm-tizen-644401875d02f4fad5e8e5a004aa9bd08153ba84.zip
- python: include instance in IDTXload, filename in IDTXglob, return
- python: argument to ts.addErase (if integer) deletes that instance. - python: rpmmi methods to return this instance, and number of members. CVS patchset: 5620 CVS date: 2002/08/09 23:14:10
Diffstat (limited to 'python/rpmmi-py.c')
-rw-r--r--python/rpmmi-py.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
index 17ee71a09..24f5d0d2a 100644
--- a/python/rpmmi-py.c
+++ b/python/rpmmi-py.c
@@ -122,6 +122,42 @@ rpmmi_Next(rpmmiObject * s, PyObject *args)
/**
*/
static PyObject *
+rpmmi_Instance(rpmmiObject * s, PyObject * args)
+ /*@globals _Py_NoneStruct @*/
+ /*@modifies s, _Py_NoneStruct @*/
+{
+ int rc = 0;
+
+ if (!PyArg_ParseTuple(args, ":Instance"))
+ return NULL;
+
+ if (s->mi)
+ rc = rpmdbGetIteratorOffset(s->mi);
+
+ return Py_BuildValue("i", rc);
+}
+
+/**
+ */
+static PyObject *
+rpmmi_Count(rpmmiObject * s, PyObject * args)
+ /*@globals _Py_NoneStruct @*/
+ /*@modifies s, _Py_NoneStruct @*/
+{
+ int rc = 0;
+
+ if (!PyArg_ParseTuple(args, ":Instance"))
+ return NULL;
+
+ if (s->mi)
+ rc = rpmdbGetIteratorCount(s->mi);
+
+ return Py_BuildValue("i", rc);
+}
+
+/**
+ */
+static PyObject *
rpmmi_Pattern(rpmmiObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
/*@modifies s, _Py_NoneStruct @*/
@@ -154,6 +190,10 @@ static struct PyMethodDef rpmmi_methods[] = {
{"next", (PyCFunction) rpmmi_Next, METH_VARARGS,
"mi.next() -> hdr\n\
- Retrieve next header that matches. Iterate directly in python if possible.\n" },
+ {"instance", (PyCFunction) rpmmi_Instance, METH_VARARGS,
+ NULL },
+ {"count", (PyCFunction) rpmmi_Count, METH_VARARGS,
+ NULL },
{"pattern", (PyCFunction) rpmmi_Pattern, METH_VARARGS,
"mi.pattern(TagN, mire_type, pattern)\n\
- Set a secondary match pattern on tags from retrieved header.\n" },