Skip to content

Commit 9d0f7bb

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 aaf1335 commit 9d0f7bb

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
@@ -11,7 +11,7 @@
1111
SERVER_PORT = 12345
1212

1313

14-
def run_webviewer(fourc_yaml_file=None):
14+
def run_webviewer(no_webserver, fourc_yaml_file=None):
1515

1616
if fourc_yaml_file is None:
1717
fourc_yaml_file = str(DEFAULT_INPUT_FILE)
@@ -22,7 +22,8 @@ def run_webviewer(fourc_yaml_file=None):
2222
)
2323

2424
# start the server after everything is set up
25-
fourc_webserver.server.start(port=SERVER_PORT)
25+
if not no_webserver:
26+
fourc_webserver.server.start(port=SERVER_PORT)
2627

2728
# run cleanup
2829
fourc_webserver.cleanup()

0 commit comments

Comments
 (0)