Skip to content
Snippets Groups Projects
Commit 9ad8315f authored by fima's avatar fima :beers:
Browse files

Merge branch 'cli_auto_launch_browser' into 'main'

added argpass for no-browser

See merge request !63
parents 36085e42 749dc096
No related branches found
No related tags found
1 merge request!63added argpass for no-browser
import argparse import argparse
import qim3d
import webbrowser import webbrowser
from qim3d.gui import data_explorer, iso3d, annotation_tool, local_thickness
import qim3d
from qim3d.gui import annotation_tool, data_explorer, iso3d, local_thickness
def main(): def main():
parser = argparse.ArgumentParser(description='Qim3d command-line interface.') parser = argparse.ArgumentParser(description='Qim3d command-line interface.')
...@@ -16,6 +18,7 @@ def main(): ...@@ -16,6 +18,7 @@ def main():
gui_parser.add_argument('--local-thickness', action='store_true', help='Run local thickness tool.') gui_parser.add_argument('--local-thickness', action='store_true', help='Run local thickness tool.')
gui_parser.add_argument('--host', default='0.0.0.0', help='Desired host.') gui_parser.add_argument('--host', default='0.0.0.0', help='Desired host.')
gui_parser.add_argument('--platform', action='store_true', help='Use QIM platform address') gui_parser.add_argument('--platform', action='store_true', help='Use QIM platform address')
gui_parser.add_argument('--no-browser', action='store_true', help='Do not launch browser.')
# K3D # K3D
viz_parser = subparsers.add_parser('viz', help = 'Volumetric visualization.') viz_parser = subparsers.add_parser('viz', help = 'Volumetric visualization.')
...@@ -27,33 +30,32 @@ def main(): ...@@ -27,33 +30,32 @@ def main():
if args.subcommand == 'gui': if args.subcommand == 'gui':
arghost = args.host arghost = args.host
inbrowser = not args.no_browser # Should automatically open in browser
if args.data_explorer: if args.data_explorer:
if args.platform: if args.platform:
data_explorer.run_interface(arghost) data_explorer.run_interface(arghost)
else: else:
interface = data_explorer.Interface() interface = data_explorer.Interface()
interface.launch() interface.launch(inbrowser=inbrowser)
elif args.iso3d: elif args.iso3d:
if args.platform: if args.platform:
iso3d.run_interface(arghost) iso3d.run_interface(arghost)
else: else:
interface = iso3d.Interface() interface = iso3d.Interface()
interface.launch() interface.launch(inbrowser=inbrowser)
elif args.annotation_tool: elif args.annotation_tool:
if args.platform: if args.platform:
annotation_tool.run_interface(arghost) annotation_tool.run_interface(arghost)
else: else:
interface = annotation_tool.Interface() interface = annotation_tool.Interface()
interface.launch() interface.launch(inbrowser=inbrowser)
elif args.local_thickness: elif args.local_thickness:
if args.platform: if args.platform:
local_thickness.run_interface(arghost) local_thickness.run_interface(arghost)
else: else:
interface = local_thickness.Interface() interface = local_thickness.Interface()
interface.launch() interface.launch(inbrowser=inbrowser)
if args.subcommand == "viz": if args.subcommand == "viz":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment