summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-07-30 15:46:11 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-07-30 15:46:11 +0200
commit2215d046a10508c0d3950db6d924727b2a2db336 (patch)
treecb0183883ecf997f671fa77015d9436673266999 /python
parent0695e2f15f7a2dd905fd437a72671b9ba9776f17 (diff)
parent82166c78d6b21754bdad32ed8a94773a874d528f (diff)
downloadpython-apt-2215d046a10508c0d3950db6d924727b2a2db336.tar.gz
merged from debian-sid
Diffstat (limited to 'python')
-rw-r--r--python/cache.cc2
-rw-r--r--python/tag.cc24
2 files changed, 25 insertions, 1 deletions
diff --git a/python/cache.cc b/python/cache.cc
index 0c59f561..c7e5e76e 100644
--- a/python/cache.cc
+++ b/python/cache.cc
@@ -502,7 +502,7 @@ static PyObject *MakeDepends(PyObject *Owner,pkgCache::VerIterator &Ver,
{
"", "Depends","PreDepends","Suggests",
"Recommends","Conflicts","Replaces",
- "Obsoletes"
+ "Obsoletes", "Breaks", "Enhances"
};
PyObject *Dep = PyString_FromString(Types[Start->Type]);
LastDepType = Start->Type;
diff --git a/python/tag.cc b/python/tag.cc
index 217be290..6fe97ed5 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -92,6 +92,29 @@ static PyObject *TagSecFind(PyObject *Self,PyObject *Args)
return PyString_FromStringAndSize(Start,Stop-Start);
}
+static char *doc_FindRaw = "FindRaw(Name) -> String/None";
+static PyObject *TagSecFindRaw(PyObject *Self,PyObject *Args)
+{
+ char *Name = 0;
+ char *Default = 0;
+ if (PyArg_ParseTuple(Args,"s|z",&Name,&Default) == 0)
+ return 0;
+
+ unsigned Pos;
+ if (GetCpp<pkgTagSection>(Self).Find(Name,Pos) == false)
+ {
+ if (Default == 0)
+ Py_RETURN_NONE;
+ return PyString_FromString(Default);
+ }
+
+ const char *Start;
+ const char *Stop;
+ GetCpp<pkgTagSection>(Self).Get(Start,Stop,Pos);
+
+ return PyString_FromStringAndSize(Start,Stop-Start);
+}
+
static char *doc_FindFlag = "FindFlag(Name) -> integer/none";
static PyObject *TagSecFindFlag(PyObject *Self,PyObject *Args)
{
@@ -355,6 +378,7 @@ static PyMethodDef TagSecMethods[] =
{
// Query
{"Find",TagSecFind,METH_VARARGS,doc_Find},
+ {"FindRaw",TagSecFindRaw,METH_VARARGS,doc_FindRaw},
{"FindFlag",TagSecFindFlag,METH_VARARGS,doc_FindFlag},
{"Bytes",TagSecBytes,METH_VARARGS,doc_Bytes},