summaryrefslogtreecommitdiff
path: root/python/rpmte-py.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-03-13 12:32:45 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-03-13 12:32:45 +0200
commitfe7c0baf03d3e6ae6b5a20dac73ffe5f193b239f (patch)
tree5ecd3d96b556d1e0956a8b8087ede84ba1e4b303 /python/rpmte-py.c
parentc4b4944e8f4633d564613d46c9b8b6f143b4b8f5 (diff)
downloadlibrpm-tizen-fe7c0baf03d3e6ae6b5a20dac73ffe5f193b239f.tar.gz
librpm-tizen-fe7c0baf03d3e6ae6b5a20dac73ffe5f193b239f.tar.bz2
librpm-tizen-fe7c0baf03d3e6ae6b5a20dac73ffe5f193b239f.zip
Add Problems() method to python transaction element class
Diffstat (limited to 'python/rpmte-py.c')
-rw-r--r--python/rpmte-py.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/python/rpmte-py.c b/python/rpmte-py.c
index 8cc247c15..ca95eb14e 100644
--- a/python/rpmte-py.c
+++ b/python/rpmte-py.c
@@ -4,6 +4,7 @@
#include "rpmds-py.h"
#include "rpmfi-py.h"
#include "rpmte-py.h"
+#include "rpmps-py.h"
#include "debug.h"
@@ -30,6 +31,7 @@
* - te.Color() Return package color bits.
* - te.PkgFileSize() Return no. of bytes in package file (approx).
* - te.Parent() Return the parent element index.
+ * - te.Problems() Return problems associated with this element.
* - te.AddedKey() Return the added package index (TR_ADDED).
* - te.DependsOnKey() Return the package index for the added package (TR_REMOVED).
* - te.DBOffset() Return the Packages database instance number (TR_REMOVED)
@@ -118,6 +120,14 @@ rpmte_Parent(rpmteObject * s)
return Py_BuildValue("i", rpmteParent(s->te));
}
+static PyObject * rpmte_Problems(rpmteObject * s)
+{
+ rpmps ps = rpmteProblems(s->te);
+ PyObject *problems = rpmps_AsList(ps);
+ rpmpsFree(ps);
+ return problems;
+}
+
/*
static PyObject *
rpmte_DependsOnKey(rpmteObject * s)
@@ -209,6 +219,8 @@ static struct PyMethodDef rpmte_methods[] = {
NULL},
{"Parent", (PyCFunction)rpmte_Parent, METH_NOARGS,
NULL},
+ {"Problems",(PyCFunction)rpmte_Problems, METH_NOARGS,
+ NULL},
/* {"DependsOnKey",(PyCFunction)rpmte_DependsOnKey, METH_NOARGS,
NULL}, */
{"DBOffset",(PyCFunction)rpmte_DBOffset, METH_NOARGS,