Exemplo n.º 1
0
 def __init__(self, stage, tests):
     self.layer = Layer()
     self.stage = stage
     self.tests = tests
     data = DictClass(load(file('data/common/tests_viewer.yaml')))
     layers = [test.get_layer() for test in tests]
     self.paginator = Paginator(self.stage, layers,
                                data.get("pagination", None))
     for item in self.stage.create_items_from_yaml(data.other, self):
         self.layer.add(item)
Exemplo n.º 2
0
 def __init__(self, stage, title, text):
     self.layer = Layer()
     self.stage = stage
     data = DictClass(load(file('data/common/content_viewer.yaml')))
     title_item = self.title_text = stage.create_text(data.title)[0]
     title_item.set_top(data.container.top)
     self.title_text.set_text(title)
     text_top = title_item.get_top() + title_item.get_height() + 10
     text_height = data.container.height - (text_top - data.container.top)
     self.close = stage.create_button(data.close, self)[0]
     self.__load_items(text, data, text_top, text_height)
     self.paginator = Paginator(self.stage, self.items,
                                data.get("pagination", None))
     for item in self.stage.create_items_from_yaml(data.other):
         self.layer.add(item)
     self.layer.add(self.title_text)
     self.layer.add(self.close)