def draw(self, force=False): self.buffer = "" for item in self.controls: if item.redrawn and not item.visible: self.buffer += screen.fillBlank(item.dimension) item.redrawn = False for item in self.controls: if (force or item.redrawn ) and item.visible and item.minACL <= self.routine.acl: self.buffer += item.draw() item.redrawn = False focus = '' if self.focusedControl(): focus = screen.move_cursor(self.focusedControl().focusLine, self.focusedControl().focusColn) else: focus = screen.move_cursor(self.routine.height + 1, self.routine.width + 1) return self.buffer + focus
def __init__(self, routine, dimension, file, **kwargs): super(art, self).__init__(routine, dimension, **kwargs) self.buffer = screen.move_cursor(self.line, self.coln) self.file = file for i, line in enumerate(open(self.file)): if i < self.dimension.height: self.buffer = self.buffer + line[:self.dimension. width] + screen.move_cursor_down( 1 ) + screen.move_cursor_left( self.dimension.width)