From 42610578fead97783ad514cb745942eee2fc2188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Cuevas?= Date: Wed, 26 May 2010 14:36:44 +0200 Subject: [PATCH] =?UTF-8?q?Version=201.1,=20a=C3=B1adida=20columna=20de=20?= =?UTF-8?q?tipos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsoninspector.glade | 9 +++++++++ jsoninspector.py | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/jsoninspector.glade b/jsoninspector.glade index e7d7f17..89f3d1d 100644 --- a/jsoninspector.glade +++ b/jsoninspector.glade @@ -8,6 +8,8 @@ + + @@ -121,6 +123,13 @@ True + + + True + Tipo + True + + diff --git a/jsoninspector.py b/jsoninspector.py index 19fa18d..9cf319d 100644 --- a/jsoninspector.py +++ b/jsoninspector.py @@ -38,6 +38,11 @@ class MainWindowMethods(object): columns.pack_start(cell) columns.add_attribute(cell, 'text', 1) + cell = gtk.CellRendererText() + columns = self.builder.get_object("treeviewcolumn3") + columns.pack_start(cell) + columns.add_attribute(cell, 'text', 2) + self.window = self.builder.get_object("MainWindow") self.window.show_all() @@ -128,12 +133,14 @@ class LogicObject(object): if type(self.json[key_val]) is dict: - parent_node = treestore.append(None, [str(key_val), ""]) + parent_node = treestore.append(None, [str(key_val), "", ""]) self._loadTreeRec(treestore, self.json[key_val], parent_node) else: - treestore.append(None, [str(key_val), str(self.json[key_val])]) + treestore.append(None, [str(key_val), + str(self.json[key_val]), + str(type(self.json[key_val]))]) def _loadTreeRec(self, treestore, elems, parent_node): """ @@ -145,12 +152,14 @@ class LogicObject(object): new_parent_node = treestore.append(parent_node, [str(key_val), - ""]) + "", ""]) self._loadTreeRec(treestore, elems[key_val], new_parent_node) else: - treestore.append(parent_node, [str(key_val), str(elems[key_val])]) + treestore.append(parent_node, [str(key_val), + str(elems[key_val]), + str(type(elems[key_val]))])