diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-06-21 14:05:49 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-06-21 14:05:49 +0200 |
| commit | b81133a92aa673d0d9315e9837012e59a988333a (patch) | |
| tree | 927146f8511c5a777103a2ff2b4b56ab11c6291f /python | |
| parent | 2d962f13c554681ded71e665a429eb359742531f (diff) | |
| download | python-apt-b81133a92aa673d0d9315e9837012e59a988333a.tar.gz | |
python: Add DeprecationWarning to functions which were replaced by classes.
Diffstat (limited to 'python')
| -rw-r--r-- | python/acquire.cc | 5 | ||||
| -rw-r--r-- | python/apt_pkgmodule.cc | 2 | ||||
| -rw-r--r-- | python/cache.cc | 2 | ||||
| -rw-r--r-- | python/cdrom.cc | 2 | ||||
| -rw-r--r-- | python/depcache.cc | 8 | ||||
| -rw-r--r-- | python/pkgmanager.cc | 3 | ||||
| -rw-r--r-- | python/pkgrecords.cc | 3 | ||||
| -rw-r--r-- | python/pkgsrcrecords.cc | 11 | ||||
| -rw-r--r-- | python/sourcelist.cc | 3 | ||||
| -rw-r--r-- | python/tag.cc | 6 |
10 files changed, 37 insertions, 8 deletions
diff --git a/python/acquire.cc b/python/acquire.cc index 6b091479..d0549fd9 100644 --- a/python/acquire.cc +++ b/python/acquire.cc @@ -301,6 +301,8 @@ PyTypeObject PkgAcquireType = #ifdef COMPAT_0_7 PyObject *GetAcquire(PyObject *Self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetAcquire() is deprecated." + " Please see apt_pkg.Acquire() for the replacement.", 1); return PkgAcquireNew(&PkgAcquireType,Args,0); } #endif @@ -394,6 +396,9 @@ char *doc_GetPkgAcqFile = "GetPkgAcqFile(pkgAquire, uri[, md5, size, descr, shortDescr, destDir, destFile]) -> PkgAcqFile\n"; PyObject *GetPkgAcqFile(PyObject *Self, PyObject *Args, PyObject * kwds) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgAcqFile() is " + "deprecated. Please see apt_pkg.AcquireFile() for the " + "replacement", 1); PyObject *pyfetcher; char *uri, *md5, *descr, *shortDescr, *destDir, *destFile; int size = 0; diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index bfa59f8e..3a31440c 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -34,6 +34,8 @@ static char *doc_newConfiguration = "Construct a configuration instance"; static PyObject *newConfiguration(PyObject *self,PyObject *args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.newConfiguration() is " + "deprecated. Use apt_pkg.Configuration() instead.", 1); return CppPyObject_NEW<Configuration>(&ConfigurationType); } #endif diff --git a/python/cache.cc b/python/cache.cc index 35c8b78f..a8da6696 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -1371,6 +1371,8 @@ PyTypeObject RDepListType = #ifdef COMPAT_0_7 PyObject *TmpGetCache(PyObject *Self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetCache() is deprecated. " + "Please see apt_pkg.Cache() for the replacement.", 1); return PkgCacheNew(&PkgCacheType,Args,0); } #endif diff --git a/python/cdrom.cc b/python/cdrom.cc index e98947d1..e2651670 100644 --- a/python/cdrom.cc +++ b/python/cdrom.cc @@ -133,6 +133,8 @@ PyTypeObject PkgCdromType = #ifdef COMPAT_0_7 PyObject *GetCdrom(PyObject *Self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetCdrom() is deprecated. " + "Please see apt_pkg.Cdrom() for the replacement.", 1); return PkgCdromNew(&PkgCdromType,Args,0); } #endif diff --git a/python/depcache.cc b/python/depcache.cc index 288eb0b0..7cf8e0a2 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -701,6 +701,8 @@ PyTypeObject PkgDepCacheType = #ifdef COMPAT_0_7 PyObject *GetDepCache(PyObject *Self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetDepCache() is deprecated" + ". Please see apt_pkg.DepCache() for the replacement.",1); return PkgDepCacheNew(&PkgDepCacheType,Args,0); } #endif @@ -733,6 +735,9 @@ static PyObject *PkgProblemResolverNew(PyTypeObject *type,PyObject *Args,PyObjec #ifdef COMPAT_0_7 PyObject *GetPkgProblemResolver(PyObject *Self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgProblemResolver() is" + " deprecated. Please see apt_pkg.ProblemResolver() for the " + "replacement.", 1); return PkgProblemResolverNew(&PkgProblemResolverType,Args,0); } #endif @@ -1003,6 +1008,9 @@ PyTypeObject PkgActionGroupType = #ifdef COMPAT_0_7 PyObject *GetPkgActionGroup(PyObject *Self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgActionGroup() is " + "deprecated. Please see apt_pkg.ActionGroup() for the " + "replacement.", 1); return PkgActionGroupNew(&PkgActionGroupType,Args,0); } #endif diff --git a/python/pkgmanager.cc b/python/pkgmanager.cc index 0fd2cd92..668f7cfc 100644 --- a/python/pkgmanager.cc +++ b/python/pkgmanager.cc @@ -39,6 +39,9 @@ static PyObject *PkgManagerNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) #ifdef COMPAT_0_7 PyObject *GetPkgManager(PyObject *Self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPackageManager() is " + "deprecated. Please see apt_pkg.PackageManager() for the " + "replacement.", 1); return PkgManagerNew(&PkgManagerType,Args,0); } #endif diff --git a/python/pkgrecords.cc b/python/pkgrecords.cc index 8beefffd..1e36259d 100644 --- a/python/pkgrecords.cc +++ b/python/pkgrecords.cc @@ -214,6 +214,9 @@ PyTypeObject PkgRecordsType = #ifdef COMPAT_0_7 PyObject *GetPkgRecords(PyObject *Self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgRecords() is " + "deprecated. Please see apt_pkg.Records() for the " + "replacement.", 1); return PkgRecordsNew(&PkgRecordsType,Args,0); } #endif diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc index e6b78a83..f75934f9 100644 --- a/python/pkgsrcrecords.cc +++ b/python/pkgsrcrecords.cc @@ -255,14 +255,9 @@ PyTypeObject PkgSrcRecordsType = #ifdef COMPAT_0_7 PyObject *GetPkgSrcRecords(PyObject *Self,PyObject *Args) { -#if 0 - PyObject *Owner; - if (PyArg_ParseTuple(Args,"O!",&PkgCacheType,&Owner) == 0) - return 0; - - return HandleErrors(CppOwnedPyObject_NEW<PkgSrcRecordsStruct>(Owner, - &PkgSrcRecordsType)); -#endif + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgSrcRecords() is " + "deprecated. Please see apt_pkg.SourceRecords() for the " + "replacement.", 1); if (PyArg_ParseTuple(Args,"") == 0) return 0; diff --git a/python/sourcelist.cc b/python/sourcelist.cc index e53fccd3..2cf5eea9 100644 --- a/python/sourcelist.cc +++ b/python/sourcelist.cc @@ -163,6 +163,9 @@ PyTypeObject PkgSourceListType = #ifdef COMPAT_0_7 PyObject *GetPkgSourceList(PyObject *Self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgSourceList() is " + "deprecated. Please see apt_pkg.SourceList() for the " + "replacement.", 1); return PkgSourceListNew(&PkgSourceListType,Args,0); } #endif diff --git a/python/tag.cc b/python/tag.cc index 7e7eb21c..05423e3d 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -268,6 +268,9 @@ static PyObject *TagSecNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) { char *doc_ParseSection ="ParseSection(Text) -> TagSection() object. Deprecated."; PyObject *ParseSection(PyObject *self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseSection() is " + "deprecated. Please see apt_pkg.TagSection() for the " + "replacement.", 1); return TagSecNew(&TagSecType,Args,0); } #endif @@ -302,6 +305,9 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) #ifdef COMPAT_0_7 char *doc_ParseTagFile = "ParseTagFile(File) -> TagFile() object. Deprecated."; PyObject *ParseTagFile(PyObject *self,PyObject *Args) { + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseTagFile() is " + "deprecated. Please see apt_pkg.TagFile() for the " + "replacement.", 1); return TagFileNew(&TagFileType,Args,0); } #endif |
