def fake_gen(): fake_data = { 'cheddar': ['sharp', 'mild'], 'swiss': ['with holes', 'with lots of holes'], 'american': ['orange', 'yellow'] } return mwdv.ModelWithDefaultViews(data=fake_data)
def __call__(self): threadModels = [ tm.GreenThreadModel(gr.gr_frame) for gr in rutils._find_objects(greenlet.greenlet) ] return mwdv.ModelWithDefaultViews(threadModels, text_view=text_views.MultiView())
def test_recursive_type_propagation_with_nested_dicts(self): nested_model = mwdv.ModelWithDefaultViews(json_view='abc') data = {'a': 1, 'b': {'c': nested_model}} top_model = base_model.ReportModel(data=data) top_model.set_current_view_type('json') self.assertEqual(nested_model.attached_view, nested_model.views['json'])
def __call__(self): threadModels = [ tm.GreenThreadModel(gr.gr_frame) for gr in rutils._find_objects(greenlet.greenlet) ] thread_pairs = dict(zip(range(len(threadModels)), threadModels)) return mwdv.ModelWithDefaultViews(thread_pairs, text_view=text_views.MultiView())
def __call__(self): threadModels = [ tm.ThreadModel(thread_id, stack) for thread_id, stack in sys._current_frames().items() ] thread_pairs = dict(zip(range(len(threadModels)), threadModels)) return mwdv.ModelWithDefaultViews(thread_pairs, text_view=text_views.MultiView())
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())
def mwdv_generator(): return mwdv.ModelWithDefaultViews(data={'string': 'value', 'int': 1})