# Path: mastermind/say.py
# def level(x):


import os
from flask import Flask, jsonify, request
from tinydb import TinyDB
from .say import logger
from . import pid
@app.route('/<path:path>/')
def index(path):
    return jsonify({"links": {"start": "/{ruleset}/start/",
                              "stop": "/stop/",
                              "state": "/state/",
                              "exceptions": "/{ruleset}/exceptions/"}})


@app.route('/pid/')
def pid_number():
    return pid.message(driver.proxy_host, driver.proxy_port)


@app.route('/state/')
def state():
    message = driver.state()
    logger.info(message)
    return jsonify(message)


@app.route('/stop/')
def stop_driver():
    message = driver.stop()
    logger.info(message)
    return jsonify(message)


@app.route('/<ruleset>/start/')
def start_driver(ruleset):
    message = driver.start(ruleset)

# Path: mastermind/say.py
# def level(x):


# Path: mastermind/driver.py
import os
from flask import Flask, jsonify, request
from tinydb import TinyDB
from .say import logger
from . import pid

@app.route('/<path:path>/')
def index(path):
    return jsonify({"links": {"start": "/{ruleset}/start/",
                              "stop": "/stop/",
                              "state": "/state/",
                              "exceptions": "/{ruleset}/exceptions/"}})


@app.route('/pid/')
def pid_number():
    return pid.message(driver.proxy_host, driver.proxy_port)


@app.route('/state/')
def state():
    message = driver.state()
    logger.info(message)
    return jsonify(message)


@app.route('/stop/')
def stop_driver():
    message = driver.stop()
    logger.info(message)
    return jsonify(message)


@app.route('/<ruleset>/start/')
def start_driver(ruleset):
    message = driver.start(ruleset)

    logger.info(message)