summaryrefslogtreecommitdiff
path: root/python/apt_instmodule.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-08-18 13:49:42 +0200
committerJulian Andres Klode <jak@debian.org>2009-08-18 13:49:42 +0200
commit3f286a1033479a7cfe40bc0e81c662eb3cd1d0f3 (patch)
tree47b2cf2dacc0a0a7b69e3b2e2851af1736475afc /python/apt_instmodule.cc
parentf69208a3dc27357b19aad7879efca4300d56d8bb (diff)
downloadpython-apt-3f286a1033479a7cfe40bc0e81c662eb3cd1d0f3.tar.gz
python: Disable the functions in apt_inst if built without COMPAT_0_7.
Developers should use the class-based API instead.
Diffstat (limited to 'python/apt_instmodule.cc')
-rw-r--r--python/apt_instmodule.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/python/apt_instmodule.cc b/python/apt_instmodule.cc
index 9cb166ed..2721509e 100644
--- a/python/apt_instmodule.cc
+++ b/python/apt_instmodule.cc
@@ -23,6 +23,8 @@
#include <Python.h>
/*}}}*/
+#ifdef COMPAT_0_7
+
// debExtractControl - Exctract an arbitary control member /*{{{*/
// ---------------------------------------------------------------------
/* This is a common operation so this function will stay, but others that
@@ -149,25 +151,20 @@ static PyObject *arCheckMember(PyObject *Self,PyObject *Args)
static PyMethodDef methods[] =
{
// access to ar files
- {"ar_check_member", arCheckMember, METH_VARARGS, doc_arCheckMember},
+ {"arCheckMember", arCheckMember, METH_VARARGS, doc_arCheckMember},
// access to deb files
- {"deb_extract_control",debExtractControl,METH_VARARGS,doc_debExtractControl},
- {"deb_extract_archive",debExtractArchive,METH_VARARGS,doc_debExtractArchive},
-
- // access to tar streams
- {"tar_extract",tarExtract,METH_VARARGS,doc_tarExtract},
- {"deb_extract",debExtract,METH_VARARGS,doc_debExtract},
-
-#ifdef COMPAT_0_7
- {"arCheckMember", arCheckMember, METH_VARARGS, doc_arCheckMember},
{"debExtractControl",debExtractControl,METH_VARARGS,doc_debExtractControl},
{"debExtractArchive",debExtractArchive,METH_VARARGS,doc_debExtractArchive},
+
+ // access to tar streams
{"tarExtract",tarExtract,METH_VARARGS,doc_tarExtract},
{"debExtract",debExtract,METH_VARARGS,doc_debExtract},
-#endif
{}
};
+#else
+static PyMethodDef *methods = 0;
+#endif // defined(COMPAT_0_7)
static const char *apt_inst_doc =