From 82d8282f9d031215c5b94c64e1e2bb60648c9a62 2008-02-26 19:27:41 From: Ville M. Vainio Date: 2008-02-26 19:27:41 Subject: [PATCH] %tasks clear: clear task list --- diff --git a/IPython/Extensions/jobctrl.py b/IPython/Extensions/jobctrl.py index 92dde58..cb79851 100644 --- a/IPython/Extensions/jobctrl.py +++ b/IPython/Extensions/jobctrl.py @@ -91,8 +91,16 @@ def magic_tasks(self,line): A 'task' is a process that has been started in IPython when 'jobctrl' extension is enabled. Tasks can be killed with %kill. + + '%tasks clear' clears the task list (from stale tasks) """ ip = self.getapi() + if line.strip() == 'clear': + for k in ip.db.keys('tasks/*'): + print "Clearing",ip.db[k] + del ip.db[k] + return + ents = job_list(ip) if not ents: print "No tasks running"