From 473a3947b09fd4fdf2a30d15fd2166b4edff2eed Mon Sep 17 00:00:00 2001 From: Matthias BUSSONNIER Date: Sat, 28 Apr 2012 23:37:37 +0200 Subject: [PATCH] kernel status --- IPython/frontend/html/notebook/handlers.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/IPython/frontend/html/notebook/handlers.py b/IPython/frontend/html/notebook/handlers.py index 62b3b8275..133cd31e2 100644 --- a/IPython/frontend/html/notebook/handlers.py +++ b/IPython/frontend/html/notebook/handlers.py @@ -590,8 +590,19 @@ class NotebookRootHandler(AuthenticatedHandler): @authenticate_unless_readonly def get(self): nbm = self.application.notebook_manager + km = self.application.kernel_manager files = nbm.list_notebooks() - self.finish(jsonapi.dumps(files)) + #kernel_for_notebook + nlist=[] + for f in files : + nid = f['notebook_id'] + if km.kernel_for_notebook(nid) is not None: + f['kernel_status']='on' + else: + f['kernel_status']='off' + nlist.append(f) + print(files) + self.finish(jsonapi.dumps(nlist)) @web.authenticated def post(self):