From 9a2641b8a93ad1088d7d6b0902253d3180d7ecf6 Mon Sep 17 00:00:00 2001 From: yes Date: Thu, 19 Sep 2024 23:03:46 -0700 Subject: [PATCH 1/4] addes no-browser option --- openfl/interface/tutorial.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/openfl/interface/tutorial.py b/openfl/interface/tutorial.py index de4950ee60..83f811c5b7 100644 --- a/openfl/interface/tutorial.py +++ b/openfl/interface/tutorial.py @@ -42,12 +42,20 @@ def tutorial(context): type=IntRange(1, 65535), help="The port the Jupyter Lab server will listen on", ) -def start(ip, port): +@option( + "-no-browser", + "--no-browser", + required=False, + type=bool, + help="The Jupyter Lab server will without opening a browser", +) +def start(ip, port, no_browser): """Start the Jupyter Lab from the tutorials directory. Args: ip (str): IP address the Jupyter Lab that should start. port (int): The port the Jupyter Lab server will listen on. + no_browser (bool): The Jupyter Lab server will start without opening a browser. """ if "VIRTUAL_ENV" in environ: @@ -71,5 +79,6 @@ def start(ip, port): jupyter_command += ["--ip", f"{ip}"] if port is not None: jupyter_command += ["--port", f"{port}"] - + if no_browser: + jupyter_command += ["--no-browser"] check_call(jupyter_command) From 605808845a4f3b70284de6ccfe54045d488d9203 Mon Sep 17 00:00:00 2001 From: yes Date: Thu, 19 Sep 2024 23:14:01 -0700 Subject: [PATCH 2/4] docstring updated --- openfl/interface/tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfl/interface/tutorial.py b/openfl/interface/tutorial.py index 83f811c5b7..2646dc1595 100644 --- a/openfl/interface/tutorial.py +++ b/openfl/interface/tutorial.py @@ -55,7 +55,7 @@ def start(ip, port, no_browser): Args: ip (str): IP address the Jupyter Lab that should start. port (int): The port the Jupyter Lab server will listen on. - no_browser (bool): The Jupyter Lab server will start without opening a browser. + no_browser (bool): If True, the server will not open the default web browser. """ if "VIRTUAL_ENV" in environ: From c53d07fcff2c6120a0dfed3fefd3d0c9ca0bfa6c Mon Sep 17 00:00:00 2001 From: yes Date: Fri, 20 Sep 2024 00:43:58 -0700 Subject: [PATCH 3/4] typo fix --- openfl/interface/tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfl/interface/tutorial.py b/openfl/interface/tutorial.py index 2646dc1595..309af2dae5 100644 --- a/openfl/interface/tutorial.py +++ b/openfl/interface/tutorial.py @@ -47,7 +47,7 @@ def tutorial(context): "--no-browser", required=False, type=bool, - help="The Jupyter Lab server will without opening a browser", + help="If True, the server will not use the default web browser", ) def start(ip, port, no_browser): """Start the Jupyter Lab from the tutorials directory. From af30bc913274b094e903149b06112b5b4666219d Mon Sep 17 00:00:00 2001 From: yes Date: Mon, 21 Oct 2024 03:46:19 -0700 Subject: [PATCH 4/4] change for forwarding nor browser arguments to jupyter lab instead of boolean value --- openfl/interface/tutorial.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openfl/interface/tutorial.py b/openfl/interface/tutorial.py index 309af2dae5..2c1975f576 100644 --- a/openfl/interface/tutorial.py +++ b/openfl/interface/tutorial.py @@ -43,10 +43,9 @@ def tutorial(context): help="The port the Jupyter Lab server will listen on", ) @option( - "-no-browser", - "--no-browser", - required=False, - type=bool, + "-no-browser/--browser", + "--no-browser/--browser", + default=False, help="If True, the server will not use the default web browser", ) def start(ip, port, no_browser):