Commit 0b8b0d3f authored by Franziska Koehn's avatar Franziska Koehn
Browse files

button disabled when not Additional-Data-Source is defined

parent 0d308138
import gtk
import xsa.datatypereader
class ComparisonDialogView(gtk.HBox):
......@@ -38,6 +39,12 @@ class ComparisonDialogView(gtk.HBox):
button_get_indent.connect("pressed", callback_get_add_data)
vbox_ident.pack_start(button_get_indent,False,False,0)
try:
xsa.datatypereader.get_comparison_extra_source(root_type)
except Exception as e:
print e
button_get_indent.set_sensitive(False)
# Table that includes all fields
vbox_fields = gtk.VBox()
......@@ -149,7 +156,6 @@ class TreeViewIdentifier(gtk.TreeView):
data = []
def __init__(self, root_type, results, *args, **kwargs):
import xsa.datatypereader
super(TreeViewIdentifier, self).__init__(*args, **kwargs)
......@@ -169,7 +175,6 @@ class TreeViewIdentifier(gtk.TreeView):
def get_additional_data(self, host, user, passw):
import xsa.queries
import xsa.datatypereader
rest = xsa.datatypereader.get_comparison_extra_source(self.root_type)
......@@ -267,7 +272,6 @@ class TreeViewFields(gtk.TreeView):
self.append_column(column)
def prepare_additional_data(self, data):
import xsa.datatypereader
from collections import defaultdict
identifiers = xsa.datatypereader.get_comparison_identifier(self.root_type)
type_fieldkeys = xsa.datatypereader.get_keys(self.root_type)
......@@ -286,7 +290,6 @@ class TreeViewFields(gtk.TreeView):
self.store.append([False, d, prepared_data[d], False,d])
def create_model(self, results):
import xsa.datatypereader
labels = {}
for field_key in results.headers():
......@@ -314,7 +317,6 @@ class TreeViewFields(gtk.TreeView):
self.set_model(self.store_filter)
def concatenate_identifier_string(self, result):
import xsa.datatypereader
identifiers = xsa.datatypereader.get_comparison_identifier(self.root_type)
indents = ""
for i in identifiers:
......
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