import flask

from cauldron.cli.server import run as server_runner
from cauldron.ui import arguments
from cauldron.ui import statuses


@server_runner.APPLICATION.route('/ui-status', methods=['POST'])
def ui_status():
    args = arguments.from_request()
    last_timestamp = args.get('last_timestamp', 0)
    force = args.get('force', False)
    results = statuses.get_status(last_timestamp, force)
    return flask.jsonify(results)

[((137, 200), 'cauldron.cli.server.run.APPLICATION.route', 'server_runner.APPLICATION.route', (['"""/ui-status"""'], {'methods': "['POST']"}), "('/ui-status', methods=['POST'])\n", (168, 200), True, 'from cauldron.cli.server import run as server_runner\n'), ((229, 253), 'cauldron.ui.arguments.from_request', 'arguments.from_request', ([], {}), '()\n', (251, 253), False, 'from cauldron.ui import arguments\n'), ((356, 398), 'cauldron.ui.statuses.get_status', 'statuses.get_status', (['last_timestamp', 'force'], {}), '(last_timestamp, force)\n', (375, 398), False, 'from cauldron.ui import statuses\n'), ((410, 432), 'flask.jsonify', 'flask.jsonify', (['results'], {}), '(results)\n', (423, 432), False, 'import flask\n')]