def loadtrace(self, from_file): entry_map = trace.build_tree(trace.entry_stream(from_file)) self.entry_map = entry_map treestore = gtk.TreeStore(int, str) def add_tree(entry, parent): row = [entry.id, entry.message] it = treestore.append(parent, row) for child in entry.children: add_tree(child, it) add_tree(entry_map[0], None) self.tree.set_model(treestore) self.tree.expand_row((0,), False)
def loadtrace(self, from_file): entry_map = trace.build_tree(trace.entry_stream(from_file)) self.entry_map = entry_map treestore = gtk.TreeStore(int, str) def add_tree(entry, parent): row = [entry.id, entry.message] it = treestore.append(parent, row) for child in entry.children: add_tree(child, it) add_tree(entry_map[0], None) self.tree.set_model(treestore) self.tree.expand_row((0, ), False)
def tracelist_add(self, base, path): if path in self.trace_list_set: return if not os.path.isfile(path): return # Check if it is a trace file try: with open(path, 'rb') as from_file: for entry in trace.entry_stream(from_file): break except trace.DecodeError: return self.trace_list_store.append([base, path]) self.trace_list_set.add(path)