from flask import Blueprint, render_template
from gateways.models import getWeatherData


web = Blueprint("web", __name__, template_folder='templates')

@web.route("/", methods=['GET'])
def home():
    items = getWeatherData.get_last_item()
    cityName = items["city"]
    return render_template("index.html",
                            city=cityName[0],
                            temperature=items["temperature"],
                            humidity=items["humidity"],
                            pressure=items["pressure"])

#@web.route("/profile", methods=['GET'])
#def profile():
#    items = getWeatherData.get_last_item()
#    return render_template("profile.html",
#                            celcius=items["temperature"],
#                            humidity=items["humidity"],
#                            pressure=items["pressure"])


#@web.route("/about", methods=['GET'])
#def about():
#    return render_template("about.html")

[((5, 6, 5, 61), 'flask.Blueprint', 'Blueprint', (), '', False, 'from flask import Blueprint, render_template\n'), ((9, 12, 9, 42), 'gateways.models.getWeatherData.get_last_item', 'getWeatherData.get_last_item', ({}, {}), '()', False, 'from gateways.models import getWeatherData\n'), ((11, 11, 15, 55), 'flask.render_template', 'render_template', (), '', False, 'from flask import Blueprint, render_template\n')]