Bug#468123: Please bind pkgCache::DepType, pkgCache::CompType, and pkgCache::CompTypeDeb.
Package: python-apt
Version: 0.7.5
Severity: wishlist
Tags: patch
pkgCache::DepType, pkgCache::CompType, and pkgCache::CompTypeDeb are
handy for printing user-readable information about dependencies; it
would be nice if they were bound. I've attached a patch that does just
this.
Daniel
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages python-apt depends on:
ii apt [libapt-pkg-libc6.7 0.7.11 Advanced front-end for dpkg
ii apt-utils [libapt-inst- 0.7.11 APT utility programs
ii libc6 2.7-8 GNU C Library: Shared libraries
ii libgcc1 1:4.3-20080219-1 GCC support library
ii libstdc++6 4.3-20080219-1 The GNU Standard C++ Library v3
ii lsb-release 3.1-24 Linux Standard Base version report
ii python 2.4.4-6 An interactive high-level object-o
ii python-central 0.5.15-0.1 register and build utility for Pyt
python-apt recommends no packages.
-- no debconf information
--- python/apt_pkgmodule.cc.orig 2008-02-26 20:50:23.000000000 -0800
+++ python/apt_pkgmodule.cc 2008-02-26 20:50:30.000000000 -0800
@@ -85,6 +85,39 @@
// return Py_BuildValue("i",pkgCheckDep(B,A,Op));
}
+static char * const doc_DepType = "DepType(DepType) -> string";
+static PyObject *DepType(PyObject *Self, PyObject *Args)
+{
+ int depType;
+
+ if(PyArg_ParseTuple(Args, "i", &depType) == 0)
+ return 0;
+ else
+ return PyString_FromString(pkgCache::DepType(depType));
+}
+
+static char * const doc_CompType = "CompType(CompType) -> string";
+static PyObject *CompType(PyObject *Self, PyObject *Args)
+{
+ int compType;
+
+ if(PyArg_ParseTuple(Args, "i", &compType) == 0)
+ return 0;
+ else
+ return PyString_FromString(pkgCache::CompType(compType));
+}
+
+static char * const doc_CompTypeDeb = "CompTypeDeb(CompType) -> string";
+static PyObject *CompTypeDeb(PyObject *Self, PyObject *Args)
+{
+ int compType;
+
+ if(PyArg_ParseTuple(Args, "i", &compType) == 0)
+ return 0;
+ else
+ return PyString_FromString(pkgCache::CompTypeDeb(compType));
+}
+
static char *doc_UpstreamVersion = "UpstreamVersion(a) -> string";
static PyObject *UpstreamVersion(PyObject *Self,PyObject *Args)
{
@@ -404,6 +437,9 @@
// Depends
{"ParseDepends",ParseDepends,METH_VARARGS,doc_ParseDepends},
{"ParseSrcDepends",ParseSrcDepends,METH_VARARGS,doc_ParseDepends},
+ {"DepType",DepType,METH_VARARGS,doc_DepType},
+ {"CompType",CompType,METH_VARARGS,doc_CompType},
+ {"CompTypeDeb",CompTypeDeb,METH_VARARGS,doc_CompTypeDeb},
// Stuff
{"md5sum",md5sum,METH_VARARGS,doc_md5sum},
Reply to: