mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Merge pull request #4546 from minrk/not-in-dir-warning
fix warning condition on notebook startup
This commit is contained in:
commit
06e23487cc
@ -715,14 +715,15 @@ class NotebookApp(BaseIPythonApplication):
|
||||
|
||||
nbdir = os.path.abspath(self.notebook_manager.notebook_dir)
|
||||
f = self.file_to_run
|
||||
if f and f.startswith(nbdir):
|
||||
f = f[len(nbdir):]
|
||||
else:
|
||||
self.log.warn(
|
||||
"Probably won't be able to open notebook %s "
|
||||
"because it is not in notebook_dir %s",
|
||||
f, nbdir,
|
||||
)
|
||||
if f:
|
||||
if f.startswith(nbdir):
|
||||
f = f[len(nbdir):]
|
||||
else:
|
||||
self.log.warn(
|
||||
"Probably won't be able to open notebook %s "
|
||||
"because it is not in notebook_dir %s",
|
||||
f, nbdir,
|
||||
)
|
||||
|
||||
if os.path.isfile(self.file_to_run):
|
||||
url = url_path_join('notebooks', f)
|
||||
|
Loading…
Reference in New Issue
Block a user