Skip to content

Commit 90894ee

Browse files
authored
Merge pull request #3696 from takluyver/start-no-active-kernels
Don't show number of active kernels on notebook start
2 parents 2bad812 + 5e99156 commit 90894ee

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
@@ -1570,13 +1570,14 @@ def cleanup_kernels(self):
15701570
self.log.info(kernel_msg % n_kernels)
15711571
self.kernel_manager.shutdown_all()
15721572

1573-
def notebook_info(self):
1573+
def notebook_info(self, kernel_count=True):
15741574
"Return the current working directory and the server url information"
15751575
info = self.contents_manager.info_string() + "\n"
1576-
n_kernels = len(self.kernel_manager.list_kernel_ids())
1577-
kernel_msg = trans.ngettext("%d active kernel", "%d active kernels", n_kernels)
1578-
info += kernel_msg % n_kernels
1579-
info += "\n"
1576+
if kernel_count:
1577+
n_kernels = len(self.kernel_manager.list_kernel_ids())
1578+
kernel_msg = trans.ngettext("%d active kernel", "%d active kernels", n_kernels)
1579+
info += kernel_msg % n_kernels
1580+
info += "\n"
15801581
# Format the info so that the URL fits on a single line in 80 char display
15811582
info += _("The Jupyter Notebook is running at:\n%s") % self.display_url
15821583
return info
@@ -1633,7 +1634,7 @@ def start(self):
16331634
self.exit(1)
16341635

16351636
info = self.log.info
1636-
for line in self.notebook_info().split("\n"):
1637+
for line in self.notebook_info(kernel_count=False).split("\n"):
16371638
info(line)
16381639
info(_("Use Control-C to stop this server and shut down all kernels (twice to skip confirmation)."))
16391640
if 'dev' in notebook.__version__:

0 commit comments

Comments
 (0)