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)
| 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.""" |