##// END OF EJS Templates
frontend.html.notebook: Use utils.localinterfaces.LOCALHOST
W. Trevor King -
Show More
@@ -70,6 +70,7 b' from IPython.zmq.ipkernel import ('
70 IPKernelApp
70 IPKernelApp
71 )
71 )
72 from IPython.utils.importstring import import_item
72 from IPython.utils.importstring import import_item
73 from IPython.utils.localinterfaces import LOCALHOST
73 from IPython.utils.traitlets import (
74 from IPython.utils.traitlets import (
74 Dict, Unicode, Integer, List, Enum, Bool,
75 Dict, Unicode, Integer, List, Enum, Bool,
75 DottedObjectName
76 DottedObjectName
@@ -87,9 +88,6 b' _notebook_id_regex = r"(?P<notebook_id>\\w+-\\w+-\\w+-\\w+-\\w+)"'
87 _profile_regex = r"(?P<profile>[^\/]+)" # there is almost no text that is invalid
88 _profile_regex = r"(?P<profile>[^\/]+)" # there is almost no text that is invalid
88 _cluster_action_regex = r"(?P<action>start|stop)"
89 _cluster_action_regex = r"(?P<action>start|stop)"
89
90
90
91 LOCALHOST = '127.0.0.1'
92
93 _examples = """
91 _examples = """
94 ipython notebook # start the notebook
92 ipython notebook # start the notebook
95 ipython notebook --profile=sympy # use the sympy profile
93 ipython notebook --profile=sympy # use the sympy profile
@@ -610,7 +608,7 b' class NotebookApp(BaseIPythonApplication):'
610 info("Use Control-C to stop this server and shut down all kernels.")
608 info("Use Control-C to stop this server and shut down all kernels.")
611
609
612 if self.open_browser or self.file_to_run:
610 if self.open_browser or self.file_to_run:
613 ip = self.ip or '127.0.0.1'
611 ip = self.ip or LOCALHOST
614 try:
612 try:
615 browser = webbrowser.get(self.browser or None)
613 browser = webbrowser.get(self.browser or None)
616 except webbrowser.Error as e:
614 except webbrowser.Error as e:
@@ -8,6 +8,7 b' from IPython.testing import decorators as dec'
8
8
9 from IPython.config.loader import Config
9 from IPython.config.loader import Config
10 from IPython.frontend.html.notebook.kernelmanager import MultiKernelManager
10 from IPython.frontend.html.notebook.kernelmanager import MultiKernelManager
11 from IPython.utils.localinterfaces import LOCALHOST
11 from IPython.zmq.kernelmanager import KernelManager
12 from IPython.zmq.kernelmanager import KernelManager
12
13
13 class TestKernelManager(TestCase):
14 class TestKernelManager(TestCase):
@@ -67,7 +68,7 b' class TestKernelManager(TestCase):'
67 @dec.skip_win32
68 @dec.skip_win32
68 def test_tcp_cinfo(self):
69 def test_tcp_cinfo(self):
69 km = self._get_tcp_km()
70 km = self._get_tcp_km()
70 self._run_cinfo(km, 'tcp', '127.0.0.1')
71 self._run_cinfo(km, 'tcp', LOCALHOST)
71
72
72 def test_ipc_lifecycle(self):
73 def test_ipc_lifecycle(self):
73 km = self._get_ipc_km()
74 km = self._get_ipc_km()
General Comments 0
You need to be logged in to leave comments. Login now