From: Panu Matilainen Date: Wed, 23 Sep 2009 07:31:46 +0000 (+0300) Subject: Add hdr.format(), deprecate hdr.sprintf() X-Git-Tag: tznext/4.11.0.1.tizen20130304~2692 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ede83b6598a3026c1f016a109220929f62b0829;p=tools%2Flibrpm-tizen.git Add hdr.format(), deprecate hdr.sprintf() - sprintf() is a C'ism and format() is closer to current librpm anyway --- diff --git a/python/header-py.c b/python/header-py.c index 21a10bb..2ed8a7d 100644 --- a/python/header-py.c +++ b/python/header-py.c @@ -241,7 +241,7 @@ static PyObject * hdrFullFilelist(hdrObject * s) Py_RETURN_NONE; } -static PyObject * hdrSprintf(hdrObject * s, PyObject * args, PyObject * kwds) +static PyObject * hdrFormat(hdrObject * s, PyObject * args, PyObject * kwds) { char * fmt; char * r; @@ -264,6 +264,12 @@ static PyObject * hdrSprintf(hdrObject * s, PyObject * args, PyObject * kwds) return result; } +static PyObject * hdrSprintf(hdrObject * s, PyObject * args, PyObject * kwds) +{ + DEPRECATED_METHOD; + return hdrFormat(s, args, kwds); +} + static PyObject *hdrIsSource(hdrObject *s) { return PyBool_FromLong(headerIsSource(s->h)); @@ -319,6 +325,8 @@ static struct PyMethodDef hdr_methods[] = { NULL }, {"convert", (PyCFunction) hdrConvert, METH_VARARGS|METH_KEYWORDS, NULL }, + {"format", (PyCFunction) hdrFormat, METH_VARARGS|METH_KEYWORDS, + NULL }, {"has_key", (PyCFunction) hdrHasKey, METH_O, NULL }, {"sprintf", (PyCFunction) hdrSprintf, METH_VARARGS|METH_KEYWORDS,