From 3d8d2b3e484ec7483782037fb4b922d87b9889b7 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Mon, 25 Nov 2019 10:12:39 +0100 Subject: [PATCH] Codestyle update --- app/__init__.py | 2 +- app/corpora/events.py | 6 ++---- app/services/views.py | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 6db6d4c9..056fd474 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -23,7 +23,7 @@ def create_app(config_name): db.init_app(app) login_manager.init_app(app) mail.init_app(app) - socketio.init_app(app, message_qeue='redis://') + socketio.init_app(app, message_qeue='redis://redis') from . import events diff --git a/app/corpora/events.py b/app/corpora/events.py index 7175cda7..d487f59d 100644 --- a/app/corpora/events.py +++ b/app/corpora/events.py @@ -72,7 +72,6 @@ def corpus_analysis(message): def corpus_analysis_session_handler(app, corpus_id, session_id): with app.app_context(): ''' Setup analysis session ''' - logger.warning('[{}] Setup analysis session'.format(session_id)) corpus = Corpus.query.get(corpus_id) while corpus.status != 'analysing': db.session.refresh(corpus) @@ -84,13 +83,12 @@ def corpus_analysis_session_handler(app, corpus_id, session_id): corpus_analysis_sessions[corpus_id] = [session_id] else: corpus_analysis_sessions[corpus_id].append(session_id) - socketio.emit('request_corpus_analysis', '[201]: Created', room=session_id) + socketio.emit('request_corpus_analysis', '[201]: Created', + room=session_id) ''' Observe analysis session ''' while session_id in connected_sessions: - logger.warning('[{}] Observe analysis session'.format(session_id)) socketio.sleep(3) ''' Teardown analysis session ''' - logger.warning('[{}] Teardown analysis session'.format(session_id)) client.disconnect() corpus_analysis_clients.pop(session_id, None) corpus_analysis_sessions[corpus_id].remove(session_id) diff --git a/app/services/views.py b/app/services/views.py index 81d4781d..6cbf9d39 100644 --- a/app/services/views.py +++ b/app/services/views.py @@ -1,8 +1,8 @@ -from app import db, logger +from app import db from app.jobs.forms import AddNLPJobForm, AddOCRJobForm from app.models import Job, JobInput from flask import (abort, current_app, flash, make_response, render_template, - request, url_for) + url_for) from flask_login import current_user, login_required from werkzeug.utils import secure_filename from . import services