From 0695e2f15f7a2dd905fd437a72671b9ba9776f17 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 27 Jul 2009 10:37:50 +0200 Subject: add better commet in update --- python/progress.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/progress.cc b/python/progress.cc index 94debe40..b3e06b87 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -72,8 +72,10 @@ void PyOpProgress::Update() PyObject_SetAttrString(callbackInst, "majorChange", o); Py_XDECREF(o); - // Build up the argument list... - if(CheckChange(0.05)) + // CheckChange takes a time delta argument how often we + // should run update - for interactive UIs it makes sense + // to run ~25/sec + if(CheckChange(0.04)) { PyObject *arglist = Py_BuildValue("(f)", Percent); RunSimpleCallback("update", arglist); -- cgit v1.2.3 From ee7b1ef76f58e8dd3a744af98007c4ab8b5ab6d2 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 19 Aug 2009 16:39:57 +0200 Subject: * apt/cache.py, python/cache.cc: - add optional pulseIntevall option to "update()" * po/python-apt.pot: - refreshed --- apt/cache.py | 4 ++-- debian/changelog | 4 ++++ debian/control | 2 +- po/python-apt.pot | 12 ++++++------ python/cache.cc | 5 +++-- 5 files changed, 16 insertions(+), 11 deletions(-) (limited to 'python') diff --git a/apt/cache.py b/apt/cache.py index c1e2428c..bb396d59 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -270,7 +270,7 @@ class Cache(object): providers.append(pkg) return providers - def update(self, fetchProgress=None): + def update(self, fetchProgress=None, pulseInterval=0): " run the equivalent of apt-get update " lockfile = apt_pkg.Config.FindDir("Dir::State::Lists") + "lock" lock = apt_pkg.GetLock(lockfile) @@ -280,7 +280,7 @@ class Cache(object): try: if fetchProgress is None: fetchProgress = apt.progress.FetchProgress() - return self._cache.Update(fetchProgress, self._list) + return self._cache.Update(fetchProgress, self._list, pulseInterval) finally: os.close(lock) diff --git a/debian/changelog b/debian/changelog index 03f0ad5b..3f22d113 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,10 @@ python-apt (0.7.12.2) UNRELEASED; urgency=low [ Michael Vogt ] * apt/package.py: - add "recommends" property + * apt/cache.py, python/cache.cc: + - add optional pulseIntevall option to "update()" + * po/python-apt.pot: + - refreshed [ Julian Andres Klode ] * apt/package.py: diff --git a/debian/control b/debian/control index 7cd6f81d..ab2d343d 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.8.2 XS-Python-Version: all Build-Depends: apt-utils, debhelper (>= 7.3.5), - libapt-pkg-dev (>= 0.7.22~), + libapt-pkg-dev (>= 0.7.21), python-all-dbg, python-all-dev, python-central (>= 0.5), diff --git a/po/python-apt.pot b/po/python-apt.pot index f904a0c5..a7229893 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-07-24 13:56+0200\n" +"POT-Creation-Date: 2009-08-19 16:33+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -369,16 +369,16 @@ msgstr "" msgid "Complete" msgstr "" -#: ../apt/package.py:278 +#: ../apt/package.py:315 #, python-format msgid "Invalid unicode in description for '%s' (%s). Please report." msgstr "" -#: ../apt/package.py:747 ../apt/package.py:851 +#: ../apt/package.py:878 ../apt/package.py:982 msgid "The list of changes is not available" msgstr "" -#: ../apt/package.py:855 +#: ../apt/package.py:986 #, python-format msgid "" "The list of changes is not available yet.\n" @@ -387,7 +387,7 @@ msgid "" "until the changes become available or try again later." msgstr "" -#: ../apt/package.py:861 +#: ../apt/package.py:992 msgid "" "Failed to download the list of changes. \n" "Please check your Internet connection." @@ -400,7 +400,7 @@ msgstr "" #: ../apt/debfile.py:81 #, python-format -msgid "List of files for '%s'could not be read" +msgid "List of files for '%s' could not be read" msgstr "" #: ../apt/debfile.py:149 diff --git a/python/cache.cc b/python/cache.cc index c7e5e76e..f0da8511 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -81,13 +81,14 @@ static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args) PyObject *pyFetchProgressInst = 0; PyObject *pySourcesList = 0; - if (PyArg_ParseTuple(Args, "OO", &pyFetchProgressInst,&pySourcesList) == 0) + int pulseInterval = 5000; + if (PyArg_ParseTuple(Args, "OO|i", &pyFetchProgressInst,&pySourcesList, &pulseInterval) == 0) return 0; PyFetchProgress progress; progress.setCallbackInst(pyFetchProgressInst); pkgSourceList *source = GetCpp(pySourcesList); - bool res = ListUpdate(progress, *source); + bool res = ListUpdate(progress, *source, pulseInterval); PyObject *PyRes = Py_BuildValue("b", res); return HandleErrors(PyRes); -- cgit v1.2.3 From e62fd3c67202426ae1b91a48848e89e025a9b924 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 21 Aug 2009 16:01:12 +0200 Subject: python/cache.cc: Set default pulseInterval to 0 (matches apt-pkg's default). --- python/cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/cache.cc b/python/cache.cc index f0da8511..a88490bd 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -81,7 +81,7 @@ static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args) PyObject *pyFetchProgressInst = 0; PyObject *pySourcesList = 0; - int pulseInterval = 5000; + int pulseInterval = 0; if (PyArg_ParseTuple(Args, "OO|i", &pyFetchProgressInst,&pySourcesList, &pulseInterval) == 0) return 0; -- cgit v1.2.3 From 93a8e31689be30b48ededcd9de67bdd2daa454dd Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 21 Aug 2009 16:18:21 +0200 Subject: python/pkgsrcrecords.cc: Fix spelling error (begining should be beginning). --- debian/changelog | 4 +++- python/pkgsrcrecords.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/debian/changelog b/debian/changelog index 71d19e14..c9b1c0fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,13 +18,15 @@ python-apt (0.7.13.0) UNRELEASED; urgency=low - Add Package.is_now_broken and Package.is_inst_broken. * apt/cache.py: - Introduce ProblemResolver class (Closes: #542705) + * python/pkgsrcrecords.cc: + - Fix spelling error (begining should be beginning). * po: - Update template and the translations de.po, fr.po (Closes: #467120), ja.po (Closes: #454293). * debian/control: - Update Standards-Version to 3.8.3. - -- Julian Andres Klode Fri, 21 Aug 2009 16:12:31 +0200 + -- Julian Andres Klode Fri, 21 Aug 2009 16:17:01 +0200 python-apt (0.7.12.1) unstable; urgency=low diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc index f7f5d7a2..36493e7b 100644 --- a/python/pkgsrcrecords.cc +++ b/python/pkgsrcrecords.cc @@ -53,7 +53,7 @@ static PyObject *PkgSrcRecordsLookup(PyObject *Self,PyObject *Args) return Py_BuildValue("i", 1); } -static char *doc_PkgSrcRecordsRestart = "Start Lookup from the begining"; +static char *doc_PkgSrcRecordsRestart = "Start Lookup from the beginning"; static PyObject *PkgSrcRecordsRestart(PyObject *Self,PyObject *Args) { PkgSrcRecordsStruct &Struct = GetCpp(Self); -- cgit v1.2.3