summaryrefslogtreecommitdiff
path: root/python/progress.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-11-29 12:25:33 +0100
committerMichael Vogt <egon@bottom>2007-11-29 12:25:33 +0100
commit0fc4aa9466d57ddc4a54191eeb8775e41ad35525 (patch)
tree93b7f4e949c3c013309d397de200d058ec7b5af5 /python/progress.cc
parentbe3ddb25ea0baa259f20936f1d7a62cafa019b99 (diff)
parentabf6c5801c6b162a9dcda5099e8eb746525dc826 (diff)
downloadpython-apt-0fc4aa9466d57ddc4a54191eeb8775e41ad35525.tar.gz
* apt/package.py:
- fix apt.package.Dependency.relation initialization * python/string.cc: - fix overflow in SizeToStr() * python/metaindex.cc: - added support for the metaIndex objects * python/sourceslist.cc: - support new "List" attribute that returns the list of metaIndex source entries * python/depcache.cc: - be more threading friendly * python/tag.cc - support "None" as default in ParseSection(control).get(field, default), LP: #44470 * python/progress.cc: - fix refcount problem in OpProgress - fix refcount problem in FetchProgress - fix refcount problem in CdromProgress * apt/README.apt: - fix typo (thanks to Thomas Schoepf, closes: #387787) * po/fr.po: - merge update, thanks to Christian Perrier (closes: #435918)
Diffstat (limited to 'python/progress.cc')
-rw-r--r--python/progress.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/python/progress.cc b/python/progress.cc
index df9c2ec1..793265db 100644
--- a/python/progress.cc
+++ b/python/progress.cc
@@ -65,10 +65,11 @@ void PyOpProgress::Update()
Py_XDECREF(o);
// Build up the argument list...
- PyObject *arglist = Py_BuildValue("(f)", Percent);
if(CheckChange(0.05))
+ {
+ PyObject *arglist = Py_BuildValue("(f)", Percent);
RunSimpleCallback("update", arglist);
- Py_XDECREF(arglist);
+ }
};
void PyOpProgress::Done()
@@ -163,14 +164,19 @@ bool PyFetchProgress::Pulse(pkgAcquire * Owner)
PyObject *o;
o = Py_BuildValue("f", CurrentCPS);
PyObject_SetAttrString(callbackInst, "currentCPS", o);
+ Py_XDECREF(o);
o = Py_BuildValue("f", CurrentBytes);
PyObject_SetAttrString(callbackInst, "currentBytes", o);
+ Py_XDECREF(o);
o = Py_BuildValue("i", CurrentItems);
PyObject_SetAttrString(callbackInst, "currentItems", o);
+ Py_XDECREF(o);
o = Py_BuildValue("i", TotalItems);
PyObject_SetAttrString(callbackInst, "totalItems", o);
+ Py_XDECREF(o);
o = Py_BuildValue("f", TotalBytes);
PyObject_SetAttrString(callbackInst, "totalBytes", o);
+ Py_XDECREF(o);
PyObject *arglist = Py_BuildValue("()");
PyObject *result;
@@ -306,6 +312,7 @@ void PyCdromProgress::Update(string text, int current)
PyObject *o = Py_BuildValue("i", totalSteps);
PyObject_SetAttrString(callbackInst, "totalSteps", o);
+ Py_XDECREF(o);
RunSimpleCallback("update", arglist);
}