Commit 151f3ea0 authored by Franziska Koehn's avatar Franziska Koehn
Browse files

funtion for loading query-definitions from file updated

parent c64c91a0
......@@ -392,23 +392,19 @@ class TreeViewQuery(Gtk.TreeView):
self.set_root_type(root_type)
def add_next_to_store(values, parent):
if isinstance(values, tuple) or (len(values) == 3): # and all(isinstance(v, str) for v in values)):
# type_name = type_reader.get_field_label_by_field(self.root_type, values[0])
# self.store.append(parent,(type_name,values[1],values[2],True,self.tooltip))
print("tuple: ",values)
elif isinstance(values, str):
print("str: ", values)
elif isinstance(values, list):
print("list: ", values)
if type(values) is tuple or (len(values) == 3 and all(isinstance(v, str) for v in values)):
type_name = type_reader.get_field_label_by_field(self.root_type, values[0])
self.store.append(parent,(type_name,values[1],values[2],True,self.tooltip))
elif type(values) is list:
for v in values:
add_next_to_store(v, parent)
if v in self.methods:
parent = self.store.append(parent,(v, '', '', False, self.tooltip))
# for v in values:
# if v in self.methods:
# parent = self.store.append(parent,(v, '', '', False, self.tooltip))
# else:
# add_next_to_store(v, parent)
else:
add_next_to_store(v, parent)
else:
raise xsa.errors.CorruptedQueryError("Error while reading Query")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment