doodledashboard/cli.py
def start(dashboards, once, secrets):
    """Display a dashboard from the dashboard file(s) provided in the DASHBOARDS
       Paths and/or URLs for dashboards (URLs must secrets with http or https)
    """

    if secrets is None:
        secrets = os.path.join(os.path.expanduser("~"), "/.doodledashboard/secrets")

    try:
        loaded_secrets = try_read_secrets_file(secrets)
    except InvalidSecretsException as err:
        click.echo(get_error_message(err, default="Secrets file is invalid"), err=True)
        raise click.Abort()

    read_configs = ["""
    dashboard:
      display:
        type: console
    """]
    for dashboard_file in dashboards:
        read_configs.append(read_file(dashboard_file))

    dashboard_config = DashboardConfigReader(initialise_component_loader(), loaded_secrets)

    try:
        dashboard = read_dashboard_from_config(dashboard_config, read_configs)
    except YAMLError as err:
        click.echo(get_error_message(err, default="Dashboard configuration is invalid"), err=True)
        raise click.Abort()

    try:
        DashboardValidator().validate(dashboard)
    except ValidationException as err:
        click.echo(get_error_message(err, default="Dashboard configuration is invalid"), err=True)
        raise click.Abort()

    explain_dashboard(dashboard)

    click.echo("Dashboard running...")

    while True:
        try:
            DashboardRunner(dashboard).cycle()
        except SecretNotFound as err:
            click.echo(get_error_message(err, default="Datafeed didn't have required secret"), err=True)
            raise click.Abort()

        if once:
            break
def start(dashboards, once, secrets):
    """Display a dashboard from the dashboard file(s) provided in the DASHBOARDS
       Paths and/or URLs for dashboards (URLs must secrets with http or https)
    """

    if secrets is None:
        secrets = os.path.join(os.path.expanduser("~"), "/.doodledashboard/secrets")

    try:
        loaded_secrets = try_read_secrets_file(secrets)
    except InvalidSecretsException as err:
        click.echo(get_error_message(err, default="Secrets file is invalid"), err=True)
        raise click.Abort()

    read_configs = ["""
    dashboard:
      display:
        type: console
    """]
    for dashboard_file in dashboards:
        read_configs.append(read_file(dashboard_file))

    dashboard_config = DashboardConfigReader(initialise_component_loader(), loaded_secrets)

    try:
        dashboard = read_dashboard_from_config(dashboard_config, read_configs)
    except YAMLError as err:
        click.echo(get_error_message(err, default="Dashboard configuration is invalid"), err=True)
        raise click.Abort()

    try:
        DashboardValidator().validate(dashboard)
    except ValidationException as err:
        click.echo(get_error_message(err, default="Dashboard configuration is invalid"), err=True)
        raise click.Abort()

    explain_dashboard(dashboard)

    click.echo("Dashboard running...")

    while True:
        try:
            DashboardRunner(dashboard).cycle()
        except SecretNotFound as err:
            click.echo(get_error_message(err, default="Datafeed didn't have required secret"), err=True)
            raise click.Abort()

        if once:
            break
Display a dashboard from the dashboard file(s) provided in the DASHBOARDS
       Paths and/or URLs for dashboards (URLs must secrets with http or https)