Python binding for rpm.fi.FindFN()

This commit is contained in:
Florian Festi 2013-06-24 11:57:53 +02:00
parent 7ffa843dd0
commit 8fcab70a47
1 changed files with 14 additions and 0 deletions

View File

@ -55,6 +55,18 @@ rpmfi_FN(rpmfiObject * s, PyObject * unused)
return Py_BuildValue("s", rpmfiFN(s->fi)); return Py_BuildValue("s", rpmfiFN(s->fi));
} }
static PyObject *
rpmfi_FindFN(rpmfiObject * s, PyObject * args, PyObject * kwds)
{
char * kwlist[] = {"filename", NULL};
PyObject * filename = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "S:FindFN", kwlist,
&filename))
return NULL;
return Py_BuildValue("i", rpmfiFindFN(s->fi, PyString_AsString(filename)));
}
static PyObject * static PyObject *
rpmfi_FFlags(rpmfiObject * s, PyObject * unused) rpmfi_FFlags(rpmfiObject * s, PyObject * unused)
{ {
@ -238,6 +250,8 @@ static struct PyMethodDef rpmfi_methods[] = {
NULL}, NULL},
{"FN", (PyCFunction)rpmfi_FN, METH_NOARGS, {"FN", (PyCFunction)rpmfi_FN, METH_NOARGS,
NULL}, NULL},
{"FindFN", (PyCFunction)rpmfi_FindFN, METH_VARARGS|METH_KEYWORDS,
NULL},
{"FFlags", (PyCFunction)rpmfi_FFlags, METH_NOARGS, {"FFlags", (PyCFunction)rpmfi_FFlags, METH_NOARGS,
NULL}, NULL},
{"VFlags", (PyCFunction)rpmfi_VFlags, METH_NOARGS, {"VFlags", (PyCFunction)rpmfi_VFlags, METH_NOARGS,