summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/JobStatusDisplay.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-02-07 11:40:55 -0800
committerZac Medico <zmedico@gentoo.org>2012-02-07 15:23:59 -0800
commita3162633773ce5efd3b1cc459df147c93877d953 (patch)
tree741c30f96144661757b2473b8bd1e336ebd97233 /pym/_emerge/JobStatusDisplay.py
parent445a6ea22c132f4c06c2cc7c48ec6e7af7116962 (diff)
downloadportage-a3162633773ce5efd3b1cc459df147c93877d953.tar.gz
portage-a3162633773ce5efd3b1cc459df147c93877d953.tar.bz2
portage-a3162633773ce5efd3b1cc459df147c93877d953.zip
PollScheduler: timeouts regardless of IO events
Now PollScheduler will execute timeouts predictably, even when there no IO events being generated. This allows the Scheduler's display updates to be handled via timeout_add.
Diffstat (limited to 'pym/_emerge/JobStatusDisplay.py')
-rw-r--r--pym/_emerge/JobStatusDisplay.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pym/_emerge/JobStatusDisplay.py b/pym/_emerge/JobStatusDisplay.py
index 877a0c963..d84d1b060 100644
--- a/pym/_emerge/JobStatusDisplay.py
+++ b/pym/_emerge/JobStatusDisplay.py
@@ -209,24 +209,26 @@ class JobStatusDisplay(object):
def display(self):
"""
Display status on stdout, but only if something has
- changed since the last call.
+ changed since the last call. This always returns True,
+ for continuous scheduling via timeout_add.
"""
if self.quiet:
- return
+ return True
current_time = time.time()
time_delta = current_time - self._last_display_time
if self._displayed and \
not self._changed:
if not self._isatty:
- return
+ return True
if time_delta < self._min_display_latency:
- return
+ return True
self._last_display_time = current_time
self._changed = False
self._display_status()
+ return True
def _display_status(self):
# Don't use len(self._completed_tasks) here since that also