summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-08-27 15:52:04 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-08-27 17:33:59 +0200
commit86287e6a4fa07d03aa906965a182425320e445ce (patch)
tree765bae56e5f693af2c27344d516dcd8c119b2f26 /server
parent2afe078b3190dde19fa689a864191fb756bff46d (diff)
Replace prolog.engine.run with ask_all
Creating and destroying the pengine should be handled somewhere else. This commit also removes query functionality from prolog.engine.create.
Diffstat (limited to 'server')
-rw-r--r--server/prolog_session.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/prolog_session.py b/server/prolog_session.py
index 768f820..ee8dba3 100644
--- a/server/prolog_session.py
+++ b/server/prolog_session.py
@@ -47,10 +47,10 @@ class PrologSession(object):
if self._engine_id is not None:
prolog.engine.stop(self._engine_id)
self._engine_id = None
- reply, output = prolog.engine.create(code=code)
- if reply.get('event') != 'create':
+ engine_id, output = prolog.engine.create(code=code)
+ if not engine_id:
raise Exception('System error: could not create a prolog engine')
- self._engine_id = reply['id']
+ self._engine_id = engine_id
messages = [text for text in map(operator.itemgetter(1), output)]
status = 'error' if 'error' in map(operator.itemgetter(0), output) else 'ok'
return messages, status, False