- Can avoid to print results

git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@231 014f5005-505e-4b48-8d0a-63407b615a7c
master
LtWorf 2010-06-21 14:24:43 +07:00
parent 24b916131f
commit d7e4f64f55
1 changed files with 10 additions and 1 deletions

@ -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