Example #1
0
    def __call__(self):
        import greenlet

        threadModels = [
            tm.GreenThreadModel(gr.gr_frame)
            for gr in _find_objects(greenlet.greenlet)
        ]

        return mwdv.ModelWithDefaultViews(threadModels,
                                          text_view=text_views.MultiView())
Example #2
0
    def __call__(self):
        threadModels = dict(
            (thread_id, tm.ThreadModel(thread_id, stack))
            for thread_id, stack in sys._current_frames().items())

        if self.traceback is not None:
            curr_thread_id = threading.current_thread().ident
            threadModels[curr_thread_id] = tm.ThreadModel(
                curr_thread_id, self.traceback)

        return mwdv.ModelWithDefaultViews(threadModels,
                                          text_view=text_views.MultiView())
Example #3
0
    def test_multi_view(self):
        attached_view = text_generic.MultiView()
        self.model = base_model.ReportModel(data={},
                                            attached_view=attached_view)

        self.model['1'] = mwdv_generator()
        self.model['2'] = mwdv_generator()
        self.model['2']['int'] = 2
        self.model.set_current_view_type('text')

        target_str = ('int = 1\n'
                      'string = value\n'
                      'int = 2\n'
                      'string = value')
        self.assertEqual(target_str, six.text_type(self.model))