#!/usr/bin/env python3
"""
Genomes Attributes Viewer

Usage:
  genomes-attributes-viewer [--host HOST] [--port PORT] [--debug]

Options:
  -h --help     Show this screen.
  --version     Show version.
  --host HOST   Hostname [default: 0.0.0.0].
  --port PORT   Port [default: 8050].
  --debug       Debug mode.
"""

from dash import Dash, html, dcc
from dash.dependencies import Input, Output, State, MATCH, ALL
from dash.exceptions import PreventUpdate
import plotly.express as px
import dash_bootstrap_components as dbc
import json
import pandas as pd
import fastsubtrees
import os
from docopt import docopt

scriptdir = os.path.dirname(os.path.realpath(__file__))
import genomes_attributes_viewer
genomes_attributes_viewer.workdir = scriptdir

if __name__ == '__main__':
  args = docopt(__doc__, version=genomes_attributes_viewer.VERSION)
  import genomes_attributes_viewer.first_run as gav_fr
  gav_fr.prepare_first_run(scriptdir)
  import genomes_attributes_viewer.app as gav_app
  if args['--port'] is None:
    args['--port'] = 8050
  if args['--host'] is None:
    args['--host'] = '0.0.0.0'
  gav_app.app.run_server(debug=args["--debug"], port=args["--port"],
      host=args["--host"])
