- Able to unload relations
git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@235 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
parent
55328d6b06
commit
a608581a33
@ -43,7 +43,8 @@ class SimpleCompleter(object):
|
|||||||
|
|
||||||
def remove_completion(self,option):
|
def remove_completion(self,option):
|
||||||
'''Removes one completion from the list of the valid completion options'''
|
'''Removes one completion from the list of the valid completion options'''
|
||||||
#//TODO
|
if option in self.options:
|
||||||
|
self.options.remove(option)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def complete(self, text, state):
|
def complete(self, text, state):
|
||||||
@ -153,8 +154,12 @@ def exec_line(command):
|
|||||||
for i in relations:
|
for i in relations:
|
||||||
if not i.startswith('_'):
|
if not i.startswith('_'):
|
||||||
print i
|
print i
|
||||||
elif command.startswith('LOAD '): #Loads a relation
|
elif command.startswith('LOAD'): #Loads a relation
|
||||||
pars=command.split(' ')
|
pars=command.split(' ')
|
||||||
|
if len(pars)==1:
|
||||||
|
print "Missing parameter"
|
||||||
|
return
|
||||||
|
|
||||||
filename=pars[1]
|
filename=pars[1]
|
||||||
if len(pars)>2:
|
if len(pars)>2:
|
||||||
defname=pars[2]
|
defname=pars[2]
|
||||||
@ -162,8 +167,16 @@ def exec_line(command):
|
|||||||
defname=None
|
defname=None
|
||||||
load_relation(filename,defname)
|
load_relation(filename,defname)
|
||||||
|
|
||||||
elif command=='UNLOAD ':
|
elif command.startswith('UNLOAD'):
|
||||||
#//TODO
|
pars=command.split(' ')
|
||||||
|
if len(pars)<2:
|
||||||
|
print "Missing parameter"
|
||||||
|
return
|
||||||
|
if pars[1] in relations:
|
||||||
|
del relations[pars[1]]
|
||||||
|
completer.remove_completion(pars[1])
|
||||||
|
else:
|
||||||
|
print "No such relation %s" % pars[1]
|
||||||
pass
|
pass
|
||||||
#elif command=='SAVE': //TODO
|
#elif command=='SAVE': //TODO
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user