summaryrefslogtreecommitdiff
path: root/python/header-py.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-10-01 15:12:06 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-10-01 15:12:06 +0300
commit9c88ea2c87b5d22026400fb19f064b7967aa4743 (patch)
tree81f2870c718c744b12b149dd15befe13a144317f /python/header-py.c
parent8b704a6bf8ae2c5a922b54ff35c65525e93f0f1f (diff)
downloadlibrpm-tizen-9c88ea2c87b5d22026400fb19f064b7967aa4743.tar.gz
librpm-tizen-9c88ea2c87b5d22026400fb19f064b7967aa4743.tar.bz2
librpm-tizen-9c88ea2c87b5d22026400fb19f064b7967aa4743.zip
Deprecation tweaks
- use PyErr_WarnEx() for better control and leave the tracking up to python - use PendingDeprecationWarning for now - document the replacing functionality in the deprecation messages - make hdr.sprintf() just an alias to hdr.format() without deprecating, at least for now it'd be only a gratuitous incompatible change on python side
Diffstat (limited to 'python/header-py.c')
-rw-r--r--python/header-py.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/python/header-py.c b/python/header-py.c
index 31d5edd72..008194073 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -180,7 +180,7 @@ static PyObject * hdrUnload(hdrObject * s, PyObject * args, PyObject *keywords)
static PyObject * hdrExpandFilelist(hdrObject * s)
{
- DEPRECATED_METHOD;
+ DEPRECATED_METHOD("use hdr.convert() instead");
headerConvert(s->h, HEADERCONV_EXPANDFILELIST);
Py_RETURN_NONE;
@@ -188,7 +188,7 @@ static PyObject * hdrExpandFilelist(hdrObject * s)
static PyObject * hdrCompressFilelist(hdrObject * s)
{
- DEPRECATED_METHOD;
+ DEPRECATED_METHOD("use hdr.convert() instead");
headerConvert(s->h, HEADERCONV_COMPRESSFILELIST);
Py_RETURN_NONE;
@@ -200,7 +200,7 @@ static PyObject * hdrFullFilelist(hdrObject * s)
rpmtd fileNames = rpmtdNew();
Header h = s->h;
- DEPRECATED_METHOD;
+ DEPRECATED_METHOD("obsolete method");
if (!headerIsEntry (h, RPMTAG_BASENAMES)
|| !headerIsEntry (h, RPMTAG_DIRNAMES)
|| !headerIsEntry (h, RPMTAG_DIRINDEXES))
@@ -239,12 +239,6 @@ static PyObject * hdrFormat(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));
@@ -293,7 +287,7 @@ static PyObject * hdrWrite(hdrObject *s, PyObject *args, PyObject *kwds)
static PyObject * hdr_fiFromHeader(PyObject * s, PyObject * args, PyObject * kwds)
{
- DEPRECATED_METHOD;
+ DEPRECATED_METHOD("use convert() instead");
return PyObject_Call((PyObject *) &rpmfi_Type,
Py_BuildValue("(O)", s), kwds);
}
@@ -325,7 +319,7 @@ static struct PyMethodDef hdr_methods[] = {
NULL },
{"has_key", (PyCFunction) hdrHasKey, METH_O,
NULL },
- {"sprintf", (PyCFunction) hdrSprintf, METH_VARARGS|METH_KEYWORDS,
+ {"sprintf", (PyCFunction) hdrFormat, METH_VARARGS|METH_KEYWORDS,
NULL },
{"isSource", (PyCFunction)hdrIsSource, METH_NOARGS,
NULL },