summaryrefslogtreecommitdiff
path: root/python/depcache.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-08-24 16:45:03 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-08-24 16:45:03 +0200
commitecbf6e3a8002a1173a05decdf57f5b197482f8d2 (patch)
tree47f13f24a2401c305bcfc4173e406dc1ed91ac18 /python/depcache.cc
parenteb48d80c9a845bbb687790331c0a7c71a3365973 (diff)
parentefad08768bc116c15de5f92387e1fd88c0734fd0 (diff)
downloadpython-apt-ecbf6e3a8002a1173a05decdf57f5b197482f8d2.tar.gz
merge the mvo branch
Diffstat (limited to 'python/depcache.cc')
-rw-r--r--python/depcache.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/python/depcache.cc b/python/depcache.cc
index 0e83c956..7edb7b59 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -794,9 +794,24 @@ static PyObject *PkgActionGroupRelease(PyObject *Self,PyObject *Args)
return HandleErrors(Py_None);
}
+static PyObject *PkgActionGroupEnter(PyObject *Self,PyObject *Args) {
+ if (PyArg_ParseTuple(Args,"") == 0)
+ return 0;
+ Py_INCREF(Self);
+ return Self;
+}
+static PyObject *PkgActionGroupExit(PyObject *Self,PyObject *Args) {
+ pkgDepCache::ActionGroup *ag = GetCpp<pkgDepCache::ActionGroup*>(Self);
+ ag->release();
+ Py_RETURN_FALSE;
+}
+
+
static PyMethodDef PkgActionGroupMethods[] =
{
{"release", PkgActionGroupRelease, METH_VARARGS, "release()"},
+ {"__enter__", PkgActionGroupEnter, METH_VARARGS, "__enter__() -> self"},
+ {"__exit__", PkgActionGroupExit, METH_VARARGS, "__exit__()"},
{}
};