Skip to content

Commit ed36189

Browse files
committed
Add no-webserver flag for pipeline
- Added a flag in order to not start the created webserver object in the pipeline. - This enables preliminary testing of the created object.
1 parent 29720e4 commit ed36189

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/fourc_webviewer/cli_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ def get_arguments():
1818
dict: Arguments dictionary
1919
"""
2020
parser = argparse.ArgumentParser(description="4C Webviewer")
21+
parser.add_argument(
22+
"--no_webserver",
23+
action="store_true",
24+
help="Don't start the webserver with its GUI?",
25+
)
2126
parser.add_argument(
2227
"--fourc_yaml_file", type=str, help="input file path to visualize"
2328
)
29+
parser.set_defaults(no_webserver=False)
2430

2531
args = parser.parse_args()
2632

src/fourc_webviewer/run_webserver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
SERVER_PORT = 12345
99

1010

11-
def run_webviewer(fourc_yaml_file=None):
11+
def run_webviewer(no_webserver, fourc_yaml_file=None):
1212
"""Runs the webviewer by creating a dedicated webserver object, starting it
1313
and cleaning up afterwards."""
1414

@@ -21,7 +21,8 @@ def run_webviewer(fourc_yaml_file=None):
2121
)
2222

2323
# start the server after everything is set up
24-
fourc_webserver.server.start(port=SERVER_PORT)
24+
if not no_webserver:
25+
fourc_webserver.server.start(port=SERVER_PORT)
2526

2627
# run cleanup
2728
fourc_webserver.cleanup()

0 commit comments

Comments
 (0)