Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
9d59aa34
Commit
9d59aa34
authored
3 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Move event handlers to a dedicated event directory
parent
0861d931
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
app/__init__.py
+2
-2
2 additions, 2 deletions
app/__init__.py
app/corpora/events.py
+1
-1
1 addition, 1 deletion
app/corpora/events.py
app/events/socketio.py
+6
-6
6 additions, 6 deletions
app/events/socketio.py
app/events/sqlalchemy.py
+2
-2
2 additions, 2 deletions
app/events/sqlalchemy.py
with
11 additions
and
11 deletions
app/__init__.py
+
2
−
2
View file @
9d59aa34
...
...
@@ -32,8 +32,8 @@ def create_app(config_name):
app
,
message_queue
=
app
.
config
[
'
NOPAQUE_SOCKETIO_MESSAGE_QUEUE_URI
'
])
with
app
.
app_context
():
from
.
import
socketio_events
from
.
import
sqlalchemy_events
from
.
events
import
socketio
as
socketio_events
from
.
events
import
sqlalchemy
as
sqlalchemy_events
from
.admin
import
admin
as
admin_blueprint
from
.auth
import
auth
as
auth_blueprint
from
.corpora
import
corpora
as
corpora_blueprint
...
...
This diff is collapsed.
Click to expand it.
app/corpora/events.py
+
1
−
1
View file @
9d59aa34
...
...
@@ -5,7 +5,7 @@ from socket import gaierror
from
werkzeug.utils
import
secure_filename
from
..
import
db
,
socketio
from
..decorators
import
socketio_login_required
from
..socketio
_events
import
socketio_sessions
from
..
events.
socketio
import
sessions
as
socketio_sessions
from
..models
import
Corpus
import
cqi
import
math
...
...
This diff is collapsed.
Click to expand it.
app/socketio
_events
.py
→
app/
events/
socketio.py
+
6
−
6
View file @
9d59aa34
from
flask
import
request
from
flask_login
import
current_user
from
flask_socketio
import
join_room
,
leave_room
from
.
import
socketio
from
.decorators
import
socketio_login_required
from
.models
import
User
from
.
.
import
socketio
from
.
.decorators
import
socketio_login_required
from
.
.models
import
User
'''
...
...
@@ -11,7 +11,7 @@ from .models import User
'
of all connected sessions, which can be used to determine the runtimes of
'
associated background tasks.
'''
socketio_
sessions
=
[]
sessions
=
[]
###############################################################################
...
...
@@ -24,7 +24,7 @@ def socketio_connect():
'
The Socket.IO module creates a session id (sid) for each request.
'
On connect the sid is saved in the connected sessions list.
'''
socketio_
sessions
.
append
(
request
.
sid
)
sessions
.
append
(
request
.
sid
)
@socketio.on
(
'
disconnect
'
)
...
...
@@ -34,7 +34,7 @@ def socketio_disconnect():
'
list.
'''
try
:
socketio_
sessions
.
remove
(
request
.
sid
)
sessions
.
remove
(
request
.
sid
)
except
ValueError
:
pass
...
...
This diff is collapsed.
Click to expand it.
app/sqlalchemy
_events
.py
→
app/
events/
sqlalchemy.py
+
2
−
2
View file @
9d59aa34
from
datetime
import
datetime
from
.
import
db
,
socketio
from
.models
import
Corpus
,
CorpusFile
,
Job
,
JobInput
,
JobResult
from
.
.
import
db
,
socketio
from
.
.models
import
Corpus
,
CorpusFile
,
Job
,
JobInput
,
JobResult
###############################################################################
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment