From acf0e2af557be18a31570f8e21ccf67233b20004 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 5 Jun 2009 16:36:52 +0200 Subject: python/: Put all deprecated Get*() functions into #ifdef COMPAT_0_7. --- python/acquire.cc | 5 ++++- python/apt_pkgmodule.cc | 2 ++ python/cache.cc | 3 ++- python/cdrom.cc | 2 ++ python/depcache.cc | 8 ++++++-- python/pkgmanager.cc | 2 ++ python/pkgrecords.cc | 4 ++-- python/pkgsrcrecords.cc | 3 ++- python/sourcelist.cc | 5 +++-- python/tag.cc | 4 ++++ 10 files changed, 29 insertions(+), 9 deletions(-) (limited to 'python') diff --git a/python/acquire.cc b/python/acquire.cc index 5f38f7bd..e6a23548 100644 --- a/python/acquire.cc +++ b/python/acquire.cc @@ -297,11 +297,12 @@ PyTypeObject PkgAcquireType = PkgAcquireNew, // tp_new }; - +#ifdef COMPAT_0_7 PyObject *GetAcquire(PyObject *Self,PyObject *Args) { return PkgAcquireNew(&PkgAcquireType,Args,0); } +#endif static PyObject *PkgAcquireFileNew(PyTypeObject *type, PyObject *Args, PyObject * kwds) { @@ -386,6 +387,7 @@ PyTypeObject PkgAcquireFileType = PkgAcquireFileNew, // tp_new }; +#ifdef COMPAT_0_7 char *doc_GetPkgAcqFile = "GetPkgAcqFile(pkgAquire, uri[, md5, size, descr, shortDescr, destDir, destFile]) -> PkgAcqFile\n"; PyObject *GetPkgAcqFile(PyObject *Self, PyObject *Args, PyObject * kwds) @@ -417,3 +419,4 @@ PyObject *GetPkgAcqFile(PyObject *Self, PyObject *Args, PyObject * kwds) return AcqFileObj; } +#endif diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index a34d4720..4ad4e56c 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -30,11 +30,13 @@ // newConfiguration - Build a new configuration class /*{{{*/ // --------------------------------------------------------------------- +#ifdef COMPAT_0_7 static char *doc_newConfiguration = "Construct a configuration instance"; static PyObject *newConfiguration(PyObject *self,PyObject *args) { return CppPyObject_NEW(&ConfigurationType); } +#endif /*}}}*/ // Version Wrappers /*{{{*/ diff --git a/python/cache.cc b/python/cache.cc index d09e22f3..38b715de 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -1345,8 +1345,9 @@ PyTypeObject RDepListType = /*}}}*/ - +#ifdef COMPAT_0_7 PyObject *TmpGetCache(PyObject *Self,PyObject *Args) { return PkgCacheNew(&PkgCacheType,Args,0); } +#endif diff --git a/python/cdrom.cc b/python/cdrom.cc index 044bbf30..3e63a89c 100644 --- a/python/cdrom.cc +++ b/python/cdrom.cc @@ -129,10 +129,12 @@ PyTypeObject PkgCdromType = PkgCdromNew, // tp_new }; +#ifdef COMPAT_0_7 PyObject *GetCdrom(PyObject *Self,PyObject *Args) { return PkgCdromNew(&PkgCdromType,Args,0); } +#endif diff --git a/python/depcache.cc b/python/depcache.cc index f69802f8..a69e0723 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -696,12 +696,12 @@ PyTypeObject PkgDepCacheType = PkgDepCacheNew, // tp_new }; - +#ifdef COMPAT_0_7 PyObject *GetDepCache(PyObject *Self,PyObject *Args) { return PkgDepCacheNew(&PkgDepCacheType,Args,0); } - +#endif @@ -729,9 +729,11 @@ static PyObject *PkgProblemResolverNew(PyTypeObject *type,PyObject *Args,PyObjec return PkgProblemResolverPyObj; } +#ifdef COMPAT_0_7 PyObject *GetPkgProblemResolver(PyObject *Self,PyObject *Args) { return PkgProblemResolverNew(&PkgProblemResolverType,Args,0); } +#endif static PyObject *PkgProblemResolverResolve(PyObject *Self,PyObject *Args) { @@ -994,10 +996,12 @@ PyTypeObject PkgActionGroupType = PkgActionGroupNew, // tp_new }; +#ifdef COMPAT_0_7 PyObject *GetPkgActionGroup(PyObject *Self,PyObject *Args) { return PkgActionGroupNew(&PkgActionGroupType,Args,0); } +#endif /*}}}*/ diff --git a/python/pkgmanager.cc b/python/pkgmanager.cc index cae2b580..7752ce5b 100644 --- a/python/pkgmanager.cc +++ b/python/pkgmanager.cc @@ -36,10 +36,12 @@ static PyObject *PkgManagerNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) return PkgManagerObj; } +#ifdef COMPAT_0_7 PyObject *GetPkgManager(PyObject *Self,PyObject *Args) { return PkgManagerNew(&PkgManagerType,Args,0); } +#endif static PyObject *PkgManagerGetArchives(PyObject *Self,PyObject *Args) diff --git a/python/pkgrecords.cc b/python/pkgrecords.cc index 212e4ab0..6022097a 100644 --- a/python/pkgrecords.cc +++ b/python/pkgrecords.cc @@ -210,9 +210,9 @@ PyTypeObject PkgRecordsType = /*}}}*/ - +#ifdef COMPAT_0_7 PyObject *GetPkgRecords(PyObject *Self,PyObject *Args) { return PkgRecordsNew(&PkgRecordsType,Args,0); } - +#endif diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc index dea7ff37..50445432 100644 --- a/python/pkgsrcrecords.cc +++ b/python/pkgsrcrecords.cc @@ -251,6 +251,7 @@ PyTypeObject PkgSrcRecordsType = /*}}}*/ +#ifdef COMPAT_0_7 PyObject *GetPkgSrcRecords(PyObject *Self,PyObject *Args) { #if 0 @@ -266,4 +267,4 @@ PyObject *GetPkgSrcRecords(PyObject *Self,PyObject *Args) return HandleErrors(CppPyObject_NEW(&PkgSrcRecordsType)); } - +#endif diff --git a/python/sourcelist.cc b/python/sourcelist.cc index daf0c08c..1c05d83e 100644 --- a/python/sourcelist.cc +++ b/python/sourcelist.cc @@ -159,8 +159,9 @@ PyTypeObject PkgSourceListType = PkgSourceListNew, // tp_new }; +#ifdef COMPAT_0_7 PyObject *GetPkgSourceList(PyObject *Self,PyObject *Args) { - return CppPyObject_NEW(&PkgSourceListType,new pkgSourceList()); + return PkgSourceListNew(&PkgSourceListType,Args,0); } - +#endif diff --git a/python/tag.cc b/python/tag.cc index c30adb0a..5a31488c 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -264,11 +264,13 @@ static PyObject *TagSecNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) { return New; } +#ifdef COMPAT_0_7 char *doc_ParseSection ="ParseSection(Text) -> TagSection() object. Deprecated."; PyObject *ParseSection(PyObject *self,PyObject *Args) { return TagSecNew(&TagSecType,Args,0); } +#endif /*}}}*/ // ParseTagFile - Parse a tagd file /*{{{*/ // --------------------------------------------------------------------- @@ -297,10 +299,12 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) return HandleErrors(New); } +#ifdef COMPAT_0_7 char *doc_ParseTagFile = "ParseTagFile(File) -> TagFile() object. Deprecated."; PyObject *ParseTagFile(PyObject *self,PyObject *Args) { return TagFileNew(&TagFileType,Args,0); } +#endif /*}}}*/ // RewriteSection - Rewrite a section.. /*{{{*/ // --------------------------------------------------------------------- -- cgit v1.2.3