Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XNAT-Group
XNAT_Query_Client_XSA
Commits
151f3ea0
Commit
151f3ea0
authored
Mar 25, 2015
by
Franziska Koehn
Browse files
funtion for loading query-definitions from file updated
parent
c64c91a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
xsagtk/query_view.py
View file @
151f3ea0
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment