Add support for checkbox/toggle columns; a debug msg for developers

svn: r14012
This commit is contained in:
Doug Blank 2010-01-10 04:03:59 +00:00
parent 2b12f3df07
commit cd17f1e0fa

View File

@ -233,9 +233,11 @@ class SimpleTable(object):
item = data[col] item = data[col]
self.__raw_data[-1].append(item) self.__raw_data[-1].append(item)
# FIXME: add better text representations of these objects # FIXME: add better text representations of these objects
if isinstance(item, basestring): if item is None:
retval.append("")
elif isinstance(item, basestring):
if item == "checkbox": if item == "checkbox":
retval.append(True) retval.append("")
self.set_cell_type(col, "checkbox") self.set_cell_type(col, "checkbox")
else: else:
retval.append(item) retval.append(item)
@ -448,7 +450,10 @@ class SimpleTable(object):
for cell in data: for cell in data:
rowdata.append(self.get_cell_markup(col, count, cell)) rowdata.append(self.get_cell_markup(col, count, cell))
col += 1 col += 1
try:
model.append(row=([count] + list(rowdata) + [col[count] for col in sort_data])) model.append(row=([count] + list(rowdata) + [col[count] for col in sort_data]))
except:
print "error in row %d: data: %s, sort data: %d" % (count, rowdata, len(sort_data[0]))
count += 1 count += 1
text_view.show_all() text_view.show_all()
self.simpledoc.paragraph("") self.simpledoc.paragraph("")