fix selector for multi-game configurations
parent
51b5e8f04c
commit
4a53aa5759
|
|
@ -213,7 +213,7 @@ if __name__ == '__main__':
|
||||||
summary(stats, stats_filtered, "raw")
|
summary(stats, stats_filtered, "raw")
|
||||||
print("\nsimplified\n")
|
print("\nsimplified\n")
|
||||||
summary(stats_simple, stats_filtered_simple, "simplified")
|
summary(stats_simple, stats_filtered_simple, "simplified")
|
||||||
|
|
||||||
####################
|
####################
|
||||||
#for cat in store.get_categories():
|
#for cat in store.get_categories():
|
||||||
# render(analyzers.ActivityMapper, store.get_category(cat), name=cat)
|
# render(analyzers.ActivityMapper, store.get_category(cat), name=cat)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ services:
|
||||||
- "traefik.url.frontend.rule=Host:select.ma.potato.kinf.wiai.uni-bamberg.de"
|
- "traefik.url.frontend.rule=Host:select.ma.potato.kinf.wiai.uni-bamberg.de"
|
||||||
|
|
||||||
celery:
|
celery:
|
||||||
image: docker.clkl.de/ma/celery:0.4.1
|
image: docker.clkl.de/ma/celery:0.4.2
|
||||||
environment:
|
environment:
|
||||||
- PYTHONPATH=/app
|
- PYTHONPATH=/app
|
||||||
- PYTHONUNBUFFERED=1
|
- PYTHONUNBUFFERED=1
|
||||||
|
|
|
||||||
|
|
@ -122,9 +122,47 @@ ACTIVITY = """{
|
||||||
]
|
]
|
||||||
}"""
|
}"""
|
||||||
|
|
||||||
CONFIGS = { # TODO: more
|
KML_geo = """{
|
||||||
"KML": KML,
|
"logFormat": "neocartographer",
|
||||||
"ActivityMapper": ACTIVITY,
|
"entryType": "type",
|
||||||
|
"spatials": [
|
||||||
|
"location"
|
||||||
|
],
|
||||||
|
"actions": [],
|
||||||
|
"boards": [],
|
||||||
|
"analyzers": {
|
||||||
|
"analysis.analyzers": [
|
||||||
|
"SimpleCategorizer",
|
||||||
|
"LocationAnalyzer"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sequences": {},
|
||||||
|
"custom": {
|
||||||
|
"coordinates": "location.coordinates",
|
||||||
|
"metadata": {
|
||||||
|
"timestamp": "timestamp",
|
||||||
|
"gamefield": "instance_id",
|
||||||
|
"user": "player_group_name"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"type": "Geogames",
|
||||||
|
"host": "http://log_data/",
|
||||||
|
"path": "neocartographer"
|
||||||
|
},
|
||||||
|
"render": [
|
||||||
|
"KMLRender"
|
||||||
|
]
|
||||||
|
}"""
|
||||||
|
|
||||||
|
CONFIGS = {
|
||||||
|
"Biogames": {
|
||||||
|
"KML": KML,
|
||||||
|
"ActivityMapper": ACTIVITY
|
||||||
|
},
|
||||||
|
"Geogames": {
|
||||||
|
"KML": KML_geo,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
URLS = {
|
URLS = {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ def login():
|
||||||
session['username'] = request.form['username']
|
session['username'] = request.form['username']
|
||||||
session['cookies'] = client.cookies
|
session['cookies'] = client.cookies
|
||||||
session['game'] = game
|
session['game'] = game
|
||||||
session['host'] = BIOGAMES_HOST
|
session['host'] = HOSTS[game]
|
||||||
clients[session['uid']] = client
|
clients[session['uid']] = client
|
||||||
return redirect("/results")
|
return redirect("/results")
|
||||||
return redirect("/?fail")
|
return redirect("/?fail")
|
||||||
|
|
@ -65,7 +65,7 @@ def games():
|
||||||
return redirect("/")
|
return redirect("/")
|
||||||
if session['logged_in'] and not session['uid'] in clients:
|
if session['logged_in'] and not session['uid'] in clients:
|
||||||
clients[session['uid']] = CLIENTS[session['game']](host=session['host'], **session['cookies'])
|
clients[session['uid']] = CLIENTS[session['game']](host=session['host'], **session['cookies'])
|
||||||
return render_template("games.html", logs=clients[session['uid']].list(), configs=CONFIGS)
|
return render_template("games.html", logs=clients[session['uid']].list(), configs=CONFIGS[session['game']])
|
||||||
|
|
||||||
|
|
||||||
@app.route("/start", methods=['POST'])
|
@app.route("/start", methods=['POST'])
|
||||||
|
|
@ -79,7 +79,7 @@ def start():
|
||||||
}
|
}
|
||||||
params = {
|
params = {
|
||||||
"log_ids": request.form.getlist('logs'),
|
"log_ids": request.form.getlist('logs'),
|
||||||
"config": CONFIGS[request.form['config']],
|
"config": CONFIGS[session['game']][request.form['config']],
|
||||||
"username": session['username'],
|
"username": session['username'],
|
||||||
"cookies": session['cookies'],
|
"cookies": session['cookies'],
|
||||||
"host": session['host'],
|
"host": session['host'],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue