Skip to content

Commit

Permalink
Fix starting notebook server with file/directory at command line.
Browse files Browse the repository at this point in the history
The base class implementation of parse_command_line uses update_config,
which ensures that the change event fires for the config traitlet. This
copies that.

Closes ipythongh-5460
  • Loading branch information
takluyver authored and Zaharid committed Apr 22, 2014
1 parent 01eacd5 commit 112ae6f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions IPython/html/notebookapp.py
Expand Up @@ -73,6 +73,7 @@

from .base.handlers import AuthenticatedFileHandler, FileFindHandler

from IPython.config import Config
from IPython.config.application import catch_config_error, boolean_flag
from IPython.core.application import BaseIPythonApplication
from IPython.core.profiledir import ProfileDir
Expand Down Expand Up @@ -554,10 +555,12 @@ def parse_command_line(self, argv=None):

# Use config here, to ensure that it takes higher priority than
# anything that comes from the profile.
c = Config()
if os.path.isdir(f):
self.config.NotebookApp.notebook_dir = f
c.NotebookApp.notebook_dir = f
elif os.path.isfile(f):
self.config.NotebookApp.file_to_run = f
c.NotebookApp.file_to_run = f
self.update_config(c)

def init_kernel_argv(self):
"""construct the kernel arguments"""
Expand Down

0 comments on commit 112ae6f

Please sign in to comment.