summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-07-20 09:51:57 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-07-20 09:51:57 +0200
commit53f514317550cc09ad3c3fb9503be51d88e3d31d (patch)
tree35710d5ddb8d0fe7960e6b6946c668de2dadc8d5
parentd445714639596ac57d4dfeb44eb6ca69fbea8190 (diff)
parentd28170024ef4d2f01fd9096a3ec785cf424c0846 (diff)
downloadpython-apt-53f514317550cc09ad3c3fb9503be51d88e3d31d.tar.gz
merged from lp:~speijnik/python-apt/debian-gsoc09
-rw-r--r--debian/changelog2
-rw-r--r--po/python-apt.pot2
-rw-r--r--python/generic.h3
-rw-r--r--python/progress.cc16
4 files changed, 17 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index cb1c932e..a08ae8e6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-python-apt (0.7.10.4) UNRELEASED; urgency=low
+python-apt (0.7.11.0) UNRELEASED; urgency=low
[ Stephan Peijnik ]
* apt/progress/__init__.py:
diff --git a/po/python-apt.pot b/po/python-apt.pot
index 2a004600..02120bfa 100644
--- a/po/python-apt.pot
+++ b/po/python-apt.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-05-05 11:44+0200\n"
+"POT-Creation-Date: 2009-07-03 12:55+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/python/generic.h b/python/generic.h
index ce79a54c..d2fcf42a 100644
--- a/python/generic.h
+++ b/python/generic.h
@@ -121,8 +121,9 @@ void CppOwnedDealloc(PyObject *iObj)
{
CppOwnedPyObject<T> *Obj = (CppOwnedPyObject<T> *)iObj;
Obj->Object.~T();
- if (Obj->Owner != 0)
+ if (Obj->Owner != 0) {
Py_DECREF(Obj->Owner);
+ }
PyObject_DEL(Obj);
}
diff --git a/python/progress.cc b/python/progress.cc
index 027a51b4..94debe40 100644
--- a/python/progress.cc
+++ b/python/progress.cc
@@ -13,6 +13,7 @@
#include <utility>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire-worker.h>
+#include "generic.h"
#include "progress.h"
// generic
@@ -336,15 +337,19 @@ bool PyFetchProgress::Pulse(pkgAcquire * Owner)
void PyInstallProgress::StartUpdate()
{
RunSimpleCallback("startUpdate");
+ PyCbObj_BEGIN_ALLOW_THREADS
}
void PyInstallProgress::UpdateInterface()
{
+ PyCbObj_END_ALLOW_THREADS
RunSimpleCallback("updateInterface");
+ PyCbObj_BEGIN_ALLOW_THREADS
}
void PyInstallProgress::FinishUpdate()
{
+ PyCbObj_END_ALLOW_THREADS
RunSimpleCallback("finishUpdate");
}
@@ -403,9 +408,9 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm)
_exit(res);
}
-
StartUpdate();
+ PyCbObj_END_ALLOW_THREADS
if(PyObject_HasAttrString(callbackInst, "waitChild")) {
PyObject *method = PyObject_GetAttrString(callbackInst, "waitChild");
//std::cerr << "custom waitChild found" << std::endl;
@@ -420,14 +425,19 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm)
int child_res;
if(!PyArg_Parse(result, "i", &res) ) {
std::cerr << "custom waitChild() result could not be parsed?"<< std::endl;
+ PyCbObj_BEGIN_ALLOW_THREADS
return pkgPackageManager::Failed;
}
+ PyCbObj_BEGIN_ALLOW_THREADS
//std::cerr << "got child_res: " << res << std::endl;
} else {
//std::cerr << "using build-in waitpid()" << std::endl;
-
- while (waitpid(child_id, &ret, WNOHANG) == 0)
+ PyCbObj_BEGIN_ALLOW_THREADS
+ while (waitpid(child_id, &ret, WNOHANG) == 0) {
+ PyCbObj_END_ALLOW_THREADS
UpdateInterface();
+ PyCbObj_BEGIN_ALLOW_THREADS
+ }
res = (pkgPackageManager::OrderResult) WEXITSTATUS(ret);
//std::cerr << "build-in waitpid() got: " << res << std::endl;