Arrange rpm.headerLoad() compatibility on python level
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 28 Sep 2009 10:30:28 +0000 (13:30 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 28 Sep 2009 10:30:28 +0000 (13:30 +0300)
python/header-py.c
python/rpm/__init__.py
python/rpmmodule.c

index 0f940af..521f5b6 100644 (file)
@@ -524,12 +524,6 @@ Header hdrGetHeader(hdrObject * s)
     return s->h;
 }
 
-PyObject * hdrLoad(PyObject * s, PyObject * args, PyObject * kwds)
-{
-    DEPRECATED_METHOD;
-    return PyObject_Call((PyObject *) &hdr_Type, args, kwds);
-}
-
 PyObject * rpmReadHeaders (FD_t fd)
 {
     PyObject * list;
index 8354bc8..e706025 100644 (file)
@@ -4,6 +4,7 @@ This module enables you to manipulate rpms and the rpm database.
 
 """
 
+import warnings
 from _rpm import *
 
 import _rpm
@@ -12,3 +13,6 @@ _RPMVSF_NOHEADER = _rpm._RPMVSF_NOHEADER
 _RPMVSF_NOPAYLOAD = _rpm._RPMVSF_NOPAYLOAD
 _RPMVSF_NOSIGNATURES = _rpm._RPMVSF_NOSIGNATURES
 
+def headerLoad(*args, **kwds):
+    warnings.warn("Use rpm.hdr() instead.", DeprecationWarning, stacklevel=2)
+    return hdr(*args, **kwds)
index d43e89c..ff516fc 100644 (file)
@@ -158,8 +158,6 @@ static PyMethodDef rpmModuleMethods[] = {
     { "checkSignals", (PyCFunction) checkSignals, METH_VARARGS,
         NULL },
 
-    { "headerLoad", (PyCFunction) hdrLoad, METH_VARARGS|METH_KEYWORDS,
-       NULL },
     { "mergeHeaderListFromFD", (PyCFunction) rpmMergeHeadersFromFD, METH_VARARGS|METH_KEYWORDS,
        NULL },
     { "readHeaderListFromFD", (PyCFunction) rpmHeaderFromFD, METH_VARARGS|METH_KEYWORDS,