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
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
9be33ffc
Commit
9be33ffc
authored
5 years ago
by
Stephan Porada
Browse files
Options
Downloads
Patches
Plain Diff
Add first tr to implement VQiWrapper
parent
8e5e8408
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/corpora/events.py
+12
-4
12 additions, 4 deletions
app/corpora/events.py
with
12 additions
and
4 deletions
app/corpora/events.py
+
12
−
4
View file @
9be33ffc
...
@@ -3,7 +3,7 @@ from app.events import connected_sessions
...
@@ -3,7 +3,7 @@ from app.events import connected_sessions
from
app.models
import
Corpus
from
app.models
import
Corpus
from
flask
import
current_app
,
request
from
flask
import
current_app
,
request
from
flask_login
import
login_required
from
flask_login
import
login_required
from
.CQi
Client.CQiClient
import
CQi
Client
from
.CQi
Wrapper.CQiWrapper
import
CQi
Wrapper
import
logging
import
logging
import
time
import
time
...
@@ -32,10 +32,18 @@ def observe_corpus_analysis_connection(app, corpus_id, session_id):
...
@@ -32,10 +32,18 @@ def observe_corpus_analysis_connection(app, corpus_id, session_id):
time
.
sleep
(
5
)
# wait for IP of container only for dev
time
.
sleep
(
5
)
# wait for IP of container only for dev
corpus
=
Corpus
.
query
.
filter_by
(
id
=
corpus_id
).
first
()
corpus
=
Corpus
.
query
.
filter_by
(
id
=
corpus_id
).
first
()
logger
.
warning
(
'
IP adress is: {}
'
.
format
(
corpus
.
analysis_container_ip
))
logger
.
warning
(
'
IP adress is: {}
'
.
format
(
corpus
.
analysis_container_ip
))
cqi_client
=
CQiClient
(
host
=
corpus
.
analysis_container_ip
)
cqi_session
=
CQiWrapper
(
username
=
'
opaque
'
,
password
=
'
opaque
'
,
cqi_client
.
ctrl_connect
(
'
opaque
'
,
'
opaque
'
)
host
=
corpus
.
analysis_container_ip
,
port
=
4877
)
cqi_session
.
connect
()
logger
.
warning
(
cqi_session
.
corpus_list_corpora
())
corpus_name
=
'
CORPUS
'
result_subcorpus_name
=
'
Query-results
'
# should be set by the user somehow
query
=
'"
and
"
;
'
cqi_session
.
create_attribute_strings
(
corpus_name
)
logger
.
warning
(
'
Log after create_attribute_strings.
'
)
cqi_session
.
query_subcorpus
(
corpus_name
,
result_subcorpus_name
,
query
)
logger
.
warning
(
'
Log after query_subcorpus.
'
)
while
session_id
in
connected_sessions
:
while
session_id
in
connected_sessions
:
logger
.
warning
(
cqi_client
.
ctrl_ping
())
logger
.
warning
(
'
Run container, run!
'
)
logger
.
warning
(
'
Run container, run!
'
)
socketio
.
sleep
(
3
)
socketio
.
sleep
(
3
)
corpus
.
status
=
'
stop analysis
'
corpus
.
status
=
'
stop analysis
'
...
...
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