Allow multiple web UIs to be open at the same time. (#784)

* Allow multiple web UIs to be open at the same time.

* Changed formatting.
This commit is contained in:
alanamarzoev
2017-07-31 18:13:24 -07:00
committed by Robert Nishihara
parent 37dafa4d14
commit a2852f2329
+8
View File
@@ -472,6 +472,14 @@ def start_ui(redis_address, stdout_file=None, stderr_file=None, cleanup=True):
new_notebook_directory = os.path.dirname(new_notebook_filepath)
shutil.copy(notebook_filepath, new_notebook_filepath)
port = 8888
while True:
try:
port_test_socket = socket.socket()
port_test_socket.bind(("127.0.0.1", port))
port_test_socket.close()
break
except OSError:
port += 1
new_env = os.environ.copy()
new_env["REDIS_ADDRESS"] = redis_address
command = ["jupyter", "notebook", "--no-browser",