From 86287e6a4fa07d03aa906965a182425320e445ce Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 27 Aug 2015 15:52:04 +0200 Subject: 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. --- server/prolog_session.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server') 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 -- cgit v1.2.1