mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-25 13:30:27 +08:00
Merge pull request #2274 from punchagan/nb-use-rev-mapper
CLN: Use name to id mapping of notebooks instead of searching.
This commit is contained in:
commit
1057564853
@ -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…
x
Reference in New Issue
Block a user