Skip to content

Commit 5e99156

Browse files
committed
Don't show number of active kernels on notebook start
1 parent 3916803 commit 5e99156

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

notebook/notebookapp.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,13 +1552,14 @@ def cleanup_kernels(self):
15521552
self.log.info(kernel_msg % n_kernels)
15531553
self.kernel_manager.shutdown_all()
15541554

1555-
def notebook_info(self):
1555+
def notebook_info(self, kernel_count=True):
15561556
"Return the current working directory and the server url information"
15571557
info = self.contents_manager.info_string() + "\n"
1558-
n_kernels = len(self.kernel_manager.list_kernel_ids())
1559-
kernel_msg = trans.ngettext("%d active kernel", "%d active kernels", n_kernels)
1560-
info += kernel_msg % n_kernels
1561-
info += "\n"
1558+
if kernel_count:
1559+
n_kernels = len(self.kernel_manager.list_kernel_ids())
1560+
kernel_msg = trans.ngettext("%d active kernel", "%d active kernels", n_kernels)
1561+
info += kernel_msg % n_kernels
1562+
info += "\n"
15621563
# Format the info so that the URL fits on a single line in 80 char display
15631564
info += _("The Jupyter Notebook is running at:\n%s") % self.display_url
15641565
return info
@@ -1615,7 +1616,7 @@ def start(self):
16151616
self.exit(1)
16161617

16171618
info = self.log.info
1618-
for line in self.notebook_info().split("\n"):
1619+
for line in self.notebook_info(kernel_count=False).split("\n"):
16191620
info(line)
16201621
info(_("Use Control-C to stop this server and shut down all kernels (twice to skip confirmation)."))
16211622
if 'dev' in notebook.__version__:

0 commit comments

Comments
 (0)