Example #1
0
 def test_main(self):
     try:
         1 / 0
     except:
         result = extract_tb(sys.exc_info()[2])
         self.assertTrue(isinstance(result, list))
         for fn, l, fu, text in result:
             self.assertTrue(isinstance(fn, fsnative))
             self.assertTrue(isinstance(l, int))
             self.assertTrue(isinstance(fu, str))
             self.assertTrue(isinstance(text, str))
Example #2
0
 def test_main(self):
     try:
         1 / 0
     except:
         result = extract_tb(sys.exc_info()[2])
         self.assertTrue(isinstance(result, list))
         for fn, l, fu, text in result:
             self.assertTrue(isinstance(fn, fsnative))
             self.assertTrue(isinstance(l, int))
             self.assertTrue(isinstance(fu, text_type))
             self.assertTrue(isinstance(text, text_type))
Example #3
0
    def __fill_list(self, view, model, value, trace):
        for frame in reversed(extract_tb(trace)):
            (filename, line, function, text) = frame
            model.append(row=[filename, function, line])
        view.connect('row-activated', self.__stack_row_activated)

        def cdf(column, cell, model, iter, data):
            row = model[iter]
            filename = fsn2text(unexpand(row[0]))
            function = row[1]
            line = row[2]
            cell.set_property(
                "markup", "<b>%s</b> line %d\n\t%s" %
                (util.escape(function), line, util.escape(filename)))

        render = Gtk.CellRendererText()
        col = Gtk.TreeViewColumn(u"", render)
        col.set_cell_data_func(render, cdf)
        col.set_visible(True)
        col.set_expand(True)
        view.append_column(col)
Example #4
0
    def __fill_list(self, view, model, value, trace):
        for frame in reversed(extract_tb(trace)):
            (filename, line, function, text) = frame
            model.append(row=[filename, function, line])
        view.connect('row-activated', self.__stack_row_activated)

        def cdf(column, cell, model, iter, data):
            row = model[iter]
            filename = fsn2text(unexpand(row[0]))
            function = row[1]
            line = row[2]
            cell.set_property(
                "markup", "<b>%s</b> line %d\n\t%s" % (
                    util.escape(function), line, util.escape(filename)))

        render = Gtk.CellRendererText()
        col = Gtk.TreeViewColumn(text_type(value).replace("_", "__"), render)
        col.set_cell_data_func(render, cdf)
        col.set_visible(True)
        col.set_expand(True)
        view.append_column(col)