remove unused imports, add a few docstrings

This commit is contained in:
Maarten de Waard 2022-10-05 14:01:06 +02:00
parent eeb2456f0f
commit 707901171e
No known key found for this signature in database
GPG key ID: 1D3E893A657CC8DA

View file

@ -2,12 +2,9 @@ from flask import jsonify
from flask_jwt_extended import jwt_required from flask_jwt_extended import jwt_required
from flask_cors import cross_origin from flask_cors import cross_origin
from sqlalchemy import func
from config import *
from .apps_service import AppsService
from database import db
from areas import api_v1 from areas import api_v1
from .apps_service import AppsService
CONFIG_DATA = [ CONFIG_DATA = [
{ {
@ -25,6 +22,7 @@ CONFIG_DATA = [
@jwt_required() @jwt_required()
@cross_origin() @cross_origin()
def get_apps(): def get_apps():
"""Return data about all apps"""
apps = AppsService.get_all_apps() apps = AppsService.get_all_apps()
return jsonify(apps) return jsonify(apps)
@ -32,6 +30,7 @@ def get_apps():
@api_v1.route('/apps/<string:slug>', methods=['GET']) @api_v1.route('/apps/<string:slug>', methods=['GET'])
@jwt_required() @jwt_required()
def get_app(slug): def get_app(slug):
"""Return data about a single app"""
app = AppsService.get_app(slug) app = AppsService.get_app(slug)
return jsonify(app) return jsonify(app)
@ -40,20 +39,23 @@ def get_app(slug):
@jwt_required() @jwt_required()
@cross_origin() @cross_origin()
def post_app(): def post_app():
return jsonify(APPS_DATA), 201 """Unused function, returns bogus data for now"""
return jsonify([]), 201
@api_v1.route('/apps/<string:slug>', methods=['PUT']) @api_v1.route('/apps/<string:slug>', methods=['PUT'])
@jwt_required() @jwt_required()
@cross_origin() @cross_origin()
def put_app(slug): def put_app(slug):
return jsonify(APPS_DATA) """Unused function, returns bogus data for now"""
return jsonify([])
@api_v1.route('/apps/<string:slug>/config', methods=['GET']) @api_v1.route('/apps/<string:slug>/config', methods=['GET'])
@jwt_required() @jwt_required()
@cross_origin() @cross_origin()
def get_config(slug): def get_config(slug):
"""Returns bogus config data"""
return jsonify(CONFIG_DATA) return jsonify(CONFIG_DATA)
@ -61,4 +63,5 @@ def get_config(slug):
@jwt_required() @jwt_required()
@cross_origin() @cross_origin()
def delete_config(slug): def delete_config(slug):
"""Does nothing, then returns bogus config data"""
return jsonify(CONFIG_DATA) return jsonify(CONFIG_DATA)