-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.py
More file actions
executable file
·57 lines (42 loc) · 1.28 KB
/
run.py
File metadata and controls
executable file
·57 lines (42 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from app import app
from flaskwebgui import FlaskUI
import logging
import platform
import argparse
import os
from utils_rov import mapping_viz
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
def get_browser_path():
possible_paths = [
"/snap/bin/chromium",
"/usr/bin/chromium"
]
for path in possible_paths:
if os.path.exists(path):
return path
return None
if __name__ == "__main__":
mapping_viz.init_mapping_viz()
parser = argparse.ArgumentParser(description="Run the NEXUS application.")
parser.add_argument("--mode", choices=["debug", "production"], required=True, help="Mode to run the application in.")
args = parser.parse_args()
app.config["MODE"] = args.mode
# NORMAL
if "Darwin" in platform.platform() or "macOS" in platform.platform():
app.run(
port=5000,
)
else:
FlaskUI(
app=app,
server="flask",
fullscreen= False,
server_kwargs={
"app": app,
"port": 5000,
"host" : "0.0.0.0",
"threaded": True,
},
browser_path= get_browser_path()
).run()