diff options
author | pauln <devnull@localhost> | 2004-11-17 17:05:39 +0000 |
---|---|---|
committer | pauln <devnull@localhost> | 2004-11-17 17:05:39 +0000 |
commit | 24e6f8633e766bb8205a2ac55ad735a97b945f8c (patch) | |
tree | 4c507b68e729601475e71a93d7527412ac435c06 /python/rpmfd-py.c | |
parent | d7a0e859ba4842548bfe344f6408af80c10b1c50 (diff) | |
download | librpm-tizen-24e6f8633e766bb8205a2ac55ad735a97b945f8c.tar.gz librpm-tizen-24e6f8633e766bb8205a2ac55ad735a97b945f8c.tar.bz2 librpm-tizen-24e6f8633e766bb8205a2ac55ad735a97b945f8c.zip |
Add kwargs everywhere - courtesy of pjones@redhat.com
CVS patchset: 7582
CVS date: 2004/11/17 17:05:39
Diffstat (limited to 'python/rpmfd-py.c')
-rw-r--r-- | python/rpmfd-py.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c index 453694b93..56814946c 100644 --- a/python/rpmfd-py.c +++ b/python/rpmfd-py.c @@ -28,11 +28,15 @@ static int _rpmfd_debug = 1; /*@null@*/ static PyObject * -rpmfd_Debug(/*@unused@*/ rpmfdObject * s, PyObject * args) +rpmfd_Debug(/*@unused@*/ rpmfdObject * s, PyObject * args, PyObject * kwds) /*@globals _Py_NoneStruct @*/ /*@modifies _Py_NoneStruct @*/ { - if (!PyArg_ParseTuple(args, "i", &_rpmfd_debug)) return NULL; + char * kwlist[] = {"debugLevel", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &_rpmfd_debug)) + return NULL; + Py_INCREF(Py_None); return Py_None; } @@ -95,15 +99,16 @@ static int closeCallback(FILE * f) */ /*@null@*/ static PyObject * -rpmfd_Fopen(/*@unused@*/ PyObject * s, PyObject * args) +rpmfd_Fopen(/*@unused@*/ PyObject * s, PyObject * args, PyObject * kwds) /*@globals fdhead, fdtail @*/ /*@modifies fdhead, fdtail @*/ { char * path; char * mode = "r.ufdio"; FDlist *node; + char * kwlist[] = {"path", "mode", NULL}; - if (!PyArg_ParseTuple(args, "s|s", &path, &mode)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s", kwlist, &path, &mode)) return NULL; node = xmalloc (sizeof(FDlist)); @@ -153,9 +158,9 @@ rpmfd_Fopen(/*@unused@*/ PyObject * s, PyObject * args) /*@-fullinitblock@*/ /*@unchecked@*/ /*@observer@*/ static struct PyMethodDef rpmfd_methods[] = { - {"Debug", (PyCFunction)rpmfd_Debug, METH_VARARGS, + {"Debug", (PyCFunction)rpmfd_Debug, METH_VARARGS|METH_KEYWORDS, NULL}, - {"Fopen", (PyCFunction)rpmfd_Fopen, METH_VARARGS, + {"Fopen", (PyCFunction)rpmfd_Fopen, METH_VARARGS|METH_KEYWORDS, NULL}, {NULL, NULL} /* sentinel */ }; @@ -195,11 +200,13 @@ static int rpmfd_init(rpmfdObject * s, PyObject *args, PyObject *kwds) { char * path; char * mode = "r.ufdio"; + char * kwlist[] = {"path", "mode", NULL}; if (_rpmfd_debug) fprintf(stderr, "*** rpmfd_init(%p,%p,%p)\n", s, args, kwds); - if (!PyArg_ParseTuple(args, "s|s:rpmfd_init", &path, &mode)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s:rpmfd_init", kwlist, + &path, &mode)) return -1; s->fd = Fopen(path, mode); |