@functools.lru_cache(maxsize=16)
def get_stylesheet(template_str):
 colordict = ColorDict(config.section('colors'))
 template = jinja2.Template(template_str)
 return template.render(color=colordict, font=config.section('fonts'), config=objreg.get('config'))

@ functools . lru_cache ( maxsize = 16 ) def get_stylesheet ( template_str ) : colordict = ColorDict ( config . section ( 'colors' ) ) template = jinja2 . Template ( template_str ) return template . render ( color = colordict , font = config . section ( 'fonts' ) , config = objreg . get ( 'config' ) )
format a stylesheet based on a template .