diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-11-18 11:22:55 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-11-18 11:22:55 +0200 |
commit | 67961448c192a932868efb6ee652bd228597d4dc (patch) | |
tree | 5d99a18b50ecb4def3b5b39217c97e07964f39ae | |
parent | f6b5a7f622c0b34fc261cc0c27b596730d9597dd (diff) | |
download | librpm-tizen-67961448c192a932868efb6ee652bd228597d4dc.tar.gz librpm-tizen-67961448c192a932868efb6ee652bd228597d4dc.tar.bz2 librpm-tizen-67961448c192a932868efb6ee652bd228597d4dc.zip |
Declare a few python functions only taking one argument as such
-rw-r--r-- | python/rpmmodule.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/python/rpmmodule.c b/python/rpmmodule.c index 13ef9bcb8..437497894 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -74,12 +74,11 @@ static PyObject * setLogFile (PyObject * self, PyObject *arg) } static PyObject * -setVerbosity (PyObject * self, PyObject * args, PyObject *kwds) +setVerbosity (PyObject * self, PyObject * arg) { int level; - char * kwlist[] = {"level", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &level)) + if (!PyArg_Parse(arg, "i", &level)) return NULL; rpmSetVerbosity(level); @@ -88,22 +87,17 @@ setVerbosity (PyObject * self, PyObject * args, PyObject *kwds) } static PyObject * -setEpochPromote (PyObject * self, PyObject * args, PyObject * kwds) +setEpochPromote (PyObject * self, PyObject * arg) { - char * kwlist[] = {"promote", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, - &_rpmds_nopromote)) + if (!PyArg_Parse(arg, "i", &_rpmds_nopromote)) return NULL; Py_RETURN_NONE; } -static PyObject * setStats (PyObject * self, PyObject * args, PyObject * kwds) +static PyObject * setStats (PyObject * self, PyObject * arg) { - char * kwlist[] = {"stats", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &_rpmts_stats)) + if (!PyArg_Parse(arg, "i", &_rpmts_stats)) return NULL; Py_RETURN_NONE; @@ -149,11 +143,11 @@ static PyMethodDef rpmModuleMethods[] = { NULL }, { "labelCompare", (PyCFunction) labelCompare, METH_VARARGS|METH_KEYWORDS, NULL }, - { "setVerbosity", (PyCFunction) setVerbosity, METH_VARARGS|METH_KEYWORDS, + { "setVerbosity", (PyCFunction) setVerbosity, METH_O, NULL }, - { "setEpochPromote", (PyCFunction) setEpochPromote, METH_VARARGS|METH_KEYWORDS, + { "setEpochPromote", (PyCFunction) setEpochPromote, METH_O, NULL }, - { "setStats", (PyCFunction) setStats, METH_VARARGS|METH_KEYWORDS, + { "setStats", (PyCFunction) setStats, METH_O, NULL }, { NULL } |