Skip to content
Snippets Groups Projects
Commit 752b3616 authored by erichard's avatar erichard
Browse files

Change import workflow with new package "labels_system"

parent aec83afd
No related branches found
No related tags found
2 merge requests!61Packager labelstower,!60WIP: Implement sqlalchemy
import os
from flask import Flask, render_template
from app.labels_system.label_system import sort
class CustomFlask(Flask):
jinja_options = Flask.jinja_options.copy()
......@@ -18,11 +17,14 @@ def create_app():
app.config.from_object(os.environ['LABELSTOWER_ENV'])
from app.labels_system import bp
app.register_blueprint(bp, url_prefix='/sort')
@app.route('/')
@app.route('/browse')
def home():
return render_template('browse.html', txt=text_component)
app.register_blueprint(sort, url_prefix='/sort')
return app
......
from flask import Blueprint
bp = Blueprint('sort', __name__)
from app.labels_system import routes
from typing import Dict, List
import json
from flask import Blueprint
from app.labels_system.getter import get_selected_elements, get_discriminating_labels, get_high_discriminating_labels
from app.labels_system import bp
sort = Blueprint('sort', __name__)
#URLs call to update labels and elements along researchs
@sort.route('/search/<int:number_of_mandatory_labels>', defaults={'optional1':'', 'optional2':''})
@sort.route('/search/<int:number_of_mandatory_labels>/<string:optional1>', defaults={'optional2':''})
@sort.route('/search/<int:number_of_mandatory_labels>/<string:optional1>/<string:optional2>')
@bp.route('/search/<int:number_of_mandatory_labels>', defaults={'optional1':'', 'optional2':''})
@bp.route('/search/<int:number_of_mandatory_labels>/<string:optional1>', defaults={'optional2':''})
@bp.route('/search/<int:number_of_mandatory_labels>/<string:optional1>/<string:optional2>')
def search(number_of_mandatory_labels: int, optional1: str, optional2: str) -> List[List[Dict[int, str]]] :
'''
Return updated lists of selected elements and high discriminating labels useful to continu research
......
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