MCPcopy Index your code
hub / github.com/ipython/ipython / flush

Method flush

IPython/lib/backgroundjobs.py:312–330  ·  view source on GitHub ↗

Flush all finished jobs (completed and dead) from lists. Running jobs are never flushed. It first calls _status_new(), to update info. If any jobs have completed since the last _status_new() call, the flush operation aborts.

(self)

Source from the content-addressed store, hash-verified

310 self.dead.remove(job)
311
312 def flush(self):
313 """Flush all finished jobs (completed and dead) from lists.
314
315 Running jobs are never flushed.
316
317 It first calls _status_new(), to update info. If any jobs have
318 completed since the last _status_new() call, the flush operation
319 aborts."""
320
321 # Remove the finished jobs from the master dict
322 alljobs = self.all
323 for job in self.completed+self.dead:
324 del(alljobs[job.num])
325
326 # Now flush these lists completely
327 fl_comp = self._group_flush(self.completed, 'Completed')
328 fl_dead = self._group_flush(self.dead, 'Dead')
329 if not (fl_comp or fl_dead):
330 print('No jobs to flush.')
331
332 def result(self,num):
333 """result(N) -> return the result of job N."""

Callers 2

test_flushFunction · 0.95
test_deadFunction · 0.95

Calls 1

_group_flushMethod · 0.95

Tested by 2

test_flushFunction · 0.76
test_deadFunction · 0.76