Skip to content
Snippets Groups Projects
Commit 0b4200f4 authored by Campos Cordobes, Sergio's avatar Campos Cordobes, Sergio
Browse files

Update app.py

parent f7290514
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,8 @@ import pysmile
import sys
import json
print(sys.path)
from src import constants
from src import constants, pysmile_license
import mysql.connector
from flask import Flask, request, render_template
......@@ -19,6 +20,16 @@ from flask import Flask, request, render_template
from src import configuration, recommender, database, planner, modal_choice
app = Flask(__name__)
model = pickle.load(open('model.pkcls', 'rb'))
"""
net = pysmile.Network()
"""
#CORS
from flask_cors import CORS
cors = CORS(app, resources={r"/*": {"origins": "*"}})
cnx = None
......@@ -29,6 +40,17 @@ def index():
# MODAL CHOICE: -------------------------------------------------------------------------------------------------------
@app.get("/modal_choice/getConfigurationFile")
def modal_choice_getconfigurationfile():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return modal_choice.modal_choice_getconfigurationfile(cnx, request)
@app.get("/modal_choice/estimation")
def modal_choice_estimation():
"""
......@@ -265,6 +287,10 @@ def database_store_kpi_relative_area():
# MAIN: ----------------------------------------------------------------------------------------------------------------
if __name__ == "__main__":
model = pickle.load(open('model.pkcls', 'rb'))
"""model = pickle.load(open('model.pkcls', 'rb'))
net = pysmile.Network()
net.read_file("URBANITE_ModalChoice.xdsl");
"""
cnx = mysql.connector.connect(**constants.DDBB_CONFIG)
app.run(debug=True, host='0.0.0.0')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment