aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-10-07 19:30:51 -0700
committerZac Medico <zmedico@gentoo.org>2012-10-07 19:30:51 -0700
commit00d168d306635ab407dec3db50dd36e99bb44375 (patch)
tree93b43af2086481ae9d0de13f16877c7b317e0923 /pym/portage
parentShow slot + repo for colliding packages. (diff)
downloadportage-00d168d306635ab407dec3db50dd36e99bb44375.tar.gz
portage-00d168d306635ab407dec3db50dd36e99bb44375.tar.bz2
portage-00d168d306635ab407dec3db50dd36e99bb44375.zip
PollScheduler: rename sched_iface to _sched_iface
It isn't used externally anymore, since SchedulerInterface is used directly in those places now. Many of the self.sched_iface references updated here, it's more appropriate to use self._event_loop.
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/tests/ebuild/test_ipc_daemon.py6
-rw-r--r--pym/portage/util/_async/AsyncScheduler.py14
2 files changed, 9 insertions, 11 deletions
diff --git a/pym/portage/tests/ebuild/test_ipc_daemon.py b/pym/portage/tests/ebuild/test_ipc_daemon.py
index 5f2257cbb..a87107625 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -110,10 +110,8 @@ class IpcDaemonTestCase(TestCase):
commands = {'exit' : exit_command}
daemon = EbuildIpcDaemon(commands=commands,
input_fifo=input_fifo,
- output_fifo=output_fifo,
- scheduler=task_scheduler.sched_iface)
- proc = SleepProcess(seconds=sleep_time_s,
- scheduler=task_scheduler.sched_iface)
+ output_fifo=output_fifo)
+ proc = SleepProcess(seconds=sleep_time_s)
task_scheduler = TaskScheduler(iter([daemon, proc]),
max_jobs=2, event_loop=event_loop)
diff --git a/pym/portage/util/_async/AsyncScheduler.py b/pym/portage/util/_async/AsyncScheduler.py
index 0648220b6..c6a37f59e 100644
--- a/pym/portage/util/_async/AsyncScheduler.py
+++ b/pym/portage/util/_async/AsyncScheduler.py
@@ -51,7 +51,7 @@ class AsyncScheduler(AsynchronousTask, PollScheduler):
self._remaining_tasks = False
else:
self._running_tasks.add(task)
- task.scheduler = self.sched_iface
+ task.scheduler = self._sched_iface
task.addExitListener(self._task_exit)
task.start()
@@ -65,31 +65,31 @@ class AsyncScheduler(AsynchronousTask, PollScheduler):
self._schedule()
def _start(self):
- self._term_check_id = self.sched_iface.idle_add(self._termination_check)
+ self._term_check_id = self._event_loop.idle_add(self._termination_check)
if self._max_load is not None:
# We have to schedule periodically, in case the load
# average has changed since the last call.
- self._loadavg_check_id = self.sched_iface.timeout_add(
+ self._loadavg_check_id = self._event_loop.timeout_add(
self._loadavg_latency, self._schedule)
self._schedule()
def _wait(self):
# Loop while there are jobs to be scheduled.
while self._keep_scheduling():
- self.sched_iface.iteration()
+ self._event_loop.iteration()
# Clean shutdown of previously scheduled jobs. In the
# case of termination, this allows for basic cleanup
# such as flushing of buffered output to logs.
while self._is_work_scheduled():
- self.sched_iface.iteration()
+ self._event_loop.iteration()
if self._term_check_id is not None:
- self.sched_iface.source_remove(self._term_check_id)
+ self._event_loop.source_remove(self._term_check_id)
self._term_check_id = None
if self._loadavg_check_id is not None:
- self.sched_iface.source_remove(self._loadavg_check_id)
+ self._event_loop.source_remove(self._loadavg_check_id)
self._loadavg_check_id = None
if self._error_count > 0: