From: Panu Matilainen Date: Fri, 2 Oct 2009 16:19:31 +0000 (+0300) Subject: Add rpmlog() wrapper to python bindings X-Git-Tag: rpm-4.8.0-beta1~153 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07ad9dcf0a8eb98928178b774512bcad2bc6f169;p=platform%2Fupstream%2Frpm.git Add rpmlog() wrapper to python bindings --- diff --git a/python/rpmmodule.c b/python/rpmmodule.c index 960f204..409ec85 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -111,6 +111,18 @@ static PyObject * setStats (PyObject * self, PyObject * args, PyObject * kwds) Py_RETURN_NONE; } +static PyObject * doLog(PyObject * self, PyObject * args, PyObject *kwds) +{ + int code; + const char *msg; + char * kwlist[] = {"code", "msg", NULL}; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "is", kwlist, &code, &msg)) + return NULL; + + rpmlog(code, "%s", msg); + Py_RETURN_NONE; +} + static PyMethodDef rpmModuleMethods[] = { { "addMacro", (PyCFunction) rpmmacro_AddMacro, METH_VARARGS|METH_KEYWORDS, NULL }, @@ -130,6 +142,8 @@ static PyMethodDef rpmModuleMethods[] = { { "mergeHeaderListFromFD", (PyCFunction) rpmMergeHeadersFromFD, METH_VARARGS|METH_KEYWORDS, NULL }, + { "log", (PyCFunction) doLog, METH_VARARGS|METH_KEYWORDS, + NULL }, { "setLogFile", (PyCFunction) setLogFile, METH_VARARGS|METH_KEYWORDS, NULL },