summaryrefslogtreecommitdiff
path: root/python/rpmmi-py.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-23 12:28:47 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-23 12:28:47 +0300
commit282efb6d4c23848b2443ffd767fd4bccda209425 (patch)
tree260228978fa8df28e77c0912e47562b3956002ed /python/rpmmi-py.c
parentac219c129d04952fbd205c536533723d582d1ad2 (diff)
downloadlibrpm-tizen-282efb6d4c23848b2443ffd767fd4bccda209425.tar.gz
librpm-tizen-282efb6d4c23848b2443ffd767fd4bccda209425.tar.bz2
librpm-tizen-282efb6d4c23848b2443ffd767fd4bccda209425.zip
Turn tagNumFromPyObject() into an object converter interface
- permits direct validation and conversion from arg parsing
Diffstat (limited to 'python/rpmmi-py.c')
-rw-r--r--python/rpmmi-py.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
index 7176844bb..5da2644ff 100644
--- a/python/rpmmi-py.c
+++ b/python/rpmmi-py.c
@@ -104,19 +104,15 @@ rpmmi_Count(rpmmiObject * s)
static PyObject *
rpmmi_Pattern(rpmmiObject * s, PyObject * args, PyObject * kwds)
{
- PyObject *TagN = NULL;
int type;
char * pattern;
rpmTag tag;
char * kwlist[] = {"tag", "type", "patern", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "Ois:Pattern", kwlist,
- &TagN, &type, &pattern))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&is:Pattern", kwlist,
+ tagNumFromPyObject, &tag, &type, &pattern))
return NULL;
- tag = tagNumFromPyObject (TagN);
- if (tag == RPMTAG_NOT_FOUND) return NULL;
-
rpmdbSetIteratorRE(s->mi, tag, type, pattern);
Py_RETURN_NONE;