# Path: chanjo_report/server/app.py
# def create_app(config=None):
#     """Create a Flask app (Flask Application Factory)."""
#     app = Flask(__name__, instance_relative_config=True)
#     configure_app(app, config=config)
#     configure_extensions(app)
#     configure_blueprints(app)
#     configure_template_filters(app)
# 
#     return app
# 
# Path: chanjo_report/server/config.py
# class ProdConfig(DefaultConfig):
#     SQLALCHEMY_TRACK_MODIFICATIONS = False
#     DEBUG = False


import click
from chanjo_report.server.app import create_app
from chanjo_report.server.config import ProdConfig
# -*- coding: utf-8 -*-



def render_html(options):
    """Start a Flask server to generate HTML report on request."""
    # spin up the Flask server
    config = ProdConfig
    config.SQLALCHEMY_DATABASE_URI = options['database']
    report_options = options['report']
    config.CHANJO_PANEL_NAME = report_options.get('panel_name')
    config.CHANJO_LANGUAGE = report_options.get('language')
    config.CHANJO_PANEL = report_options.get('panel')
    config.DEBUG = report_options.get('debug')


# Path: chanjo_report/server/app.py
# def create_app(config=None):
#     """Create a Flask app (Flask Application Factory)."""
#     app = Flask(__name__, instance_relative_config=True)
#     configure_app(app, config=config)
#     configure_extensions(app)
#     configure_blueprints(app)
#     configure_template_filters(app)
# 
#     return app
# 
# Path: chanjo_report/server/config.py
# class ProdConfig(DefaultConfig):
#     SQLALCHEMY_TRACK_MODIFICATIONS = False
#     DEBUG = False


# Path: chanjo_report/interfaces/html.py
import click
from chanjo_report.server.app import create_app
from chanjo_report.server.config import ProdConfig

# -*- coding: utf-8 -*-



def render_html(options):
    """Start a Flask server to generate HTML report on request."""
    # spin up the Flask server
    config = ProdConfig
    config.SQLALCHEMY_DATABASE_URI = options['database']
    report_options = options['report']
    config.CHANJO_PANEL_NAME = report_options.get('panel_name')
    config.CHANJO_LANGUAGE = report_options.get('language')
    config.CHANJO_PANEL = report_options.get('panel')
    config.DEBUG = report_options.get('debug')


    app = create_app(config=config)