Renderer

class plie.Renderer(size=None, view=None)[source]

Bases: object

add_view(view)[source]

Take in a valid view dict, and initialize anything that needs initializing, then store it ready for displaying

Notes

To initialize in this context means find the size for each Renderable, by examining the bounds, padding and positioning. So that when the Renderable is initialized, it can start at the appropriate size. The instance of the Renderable for each renderable section then gets added to that section.

Sections get turned into ChainMaps, if they share a name with any of the default sections, they can inherit attributes from that default.

Parameters:view – a valid view dict

Returns: nothing, but adds an initialized view to the ChainMap

composite(cellspace, position=(0, 0))[source]

Given a cellspace and position, add that to the internal dict at the correct position.

Parameters:
  • cellspace – a cell space dictionary representation of a view object
  • position – where the top left corner should go
display(update=True)[source]

Display fullscreen out to the terminal.

Parameters:update – whether or not to update before displaying

Notes

Uses Blessed for fullscreen terminal support.

formulate()[source]

Turns the internal dictionary into a string for rendering.

Returns: A string that could render the whole screen if printed.

update()[source]

Updates the internal dictionary representation