mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
CLN: Use name to id mapping of notebooks instead of searching.
Minor clean-up.
This commit is contained in:
parent
c00e56818b
commit
a8556b5d9e
@ -579,13 +579,8 @@ class NotebookApp(BaseIPythonApplication):
|
||||
browser = None
|
||||
|
||||
if self.file_to_run:
|
||||
filename, _ = os.path.splitext(os.path.basename(self.file_to_run))
|
||||
for nb in self.notebook_manager.list_notebooks():
|
||||
if filename == nb['name']:
|
||||
url = nb['notebook_id']
|
||||
break
|
||||
else:
|
||||
url = ''
|
||||
name, _ = os.path.splitext(os.path.basename(self.file_to_run))
|
||||
url = self.notebook_manager.rev_mapping.get(name, '')
|
||||
else:
|
||||
url = ''
|
||||
if browser:
|
||||
|
Loading…
Reference in New Issue
Block a user