From d7e4f64f55f72d996eb7a5c7f5a1ed500a8f1c4b Mon Sep 17 00:00:00 2001 From: LtWorf Date: Mon, 21 Jun 2010 14:24:43 +0000 Subject: [PATCH] - Can avoid to print results git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@231 014f5005-505e-4b48-8d0a-63407b615a7c --- relational_readline/linegui.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/relational_readline/linegui.py b/relational_readline/linegui.py index 1c67563..cb66867 100644 --- a/relational_readline/linegui.py +++ b/relational_readline/linegui.py @@ -141,6 +141,13 @@ def replacements(query): def exec_query(command): '''This function executes a query and prints the result on the screen''' + #If it terminates with ; doesn't print the result + if command.endswith(';'): + command=command[:-1] + printrel=False + else: + printrel=True + #Performs replacements for weird operators command=replacements(command) @@ -168,7 +175,9 @@ def exec_query(command): pyquery=parser.parse(query) result=eval(pyquery,relations) print "-> query: %s" % pyquery - print result + + if printrel: + print result relations[relname]=result