Esempio n. 1
0
 def _format(self, format_name, caller=None):
     body = caller()
     text = format_text(self.environment.app,
                        format_name,
                        Markup(body.rstrip()).unescape(),
                        exact_format=True)
     return text
Esempio n. 2
0
 def _format(self, format_name, caller=None):
     body = caller()
     text = format_text(self.environment.app,
                        format_name,
                        Markup(body.rstrip()).unescape(),
                        exact_format=True)
     return text
Esempio n. 3
0
    def render(self, ctx, data, out):
        with io.StringIO() as tmp:
            inner_out = tmp.write
            for c in self.children:
                c.render(ctx, data, inner_out)

            text = format_text(ctx.engine.piecrust_app, self.format,
                               tmp.getvalue(), exact_format=True)
            out(text)
Esempio n. 4
0
 def _formatWith(self, value, format_name):
     return format_text(self.app, format_name, value)
Esempio n. 5
0
 def _formatWith(self, value, format_name):
     return format_text(self.app, format_name, value)