From cd17f1e0fa2f2e1dbddef61423caef0bbff4a08a Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 10 Jan 2010 04:03:59 +0000 Subject: [PATCH] Add support for checkbox/toggle columns; a debug msg for developers svn: r14012 --- src/Simple/_SimpleTable.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Simple/_SimpleTable.py b/src/Simple/_SimpleTable.py index fc0c0ec78..2ce816fe6 100644 --- a/src/Simple/_SimpleTable.py +++ b/src/Simple/_SimpleTable.py @@ -233,9 +233,11 @@ class SimpleTable(object): item = data[col] self.__raw_data[-1].append(item) # 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": - retval.append(True) + retval.append("") self.set_cell_type(col, "checkbox") else: retval.append(item) @@ -448,7 +450,10 @@ class SimpleTable(object): for cell in data: rowdata.append(self.get_cell_markup(col, count, cell)) col += 1 - model.append(row=([count] + list(rowdata) + [col[count] for col in sort_data])) + try: + 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 text_view.show_all() self.simpledoc.paragraph("")