Python mako.template.bytestring_passthrough() Examples
The following are 11
code examples of mako.template.bytestring_passthrough().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
mako.template
, or try the search function
.
Example #1
Source File: runtime.py From jbox with MIT License | 6 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data)) return context._pop_buffer().getvalue()
Example #2
Source File: runtime.py From teleport with Apache License 2.0 | 6 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data)) return context._pop_buffer().getvalue()
Example #3
Source File: runtime.py From SA-ctf_scoreboard with Creative Commons Zero v1.0 Universal | 6 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data)) return context._pop_buffer().getvalue()
Example #4
Source File: runtime.py From ansible-cmdb with GNU General Public License v3.0 | 6 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data)) return context._pop_buffer().getvalue()
Example #5
Source File: runtime.py From android_universal with MIT License | 6 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data)) return context._pop_buffer().getvalue()
Example #6
Source File: runtime.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors, ) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context( template, callable_, context, *args, **_kwargs_for_callable(callable_, data) ) return context._pop_buffer().getvalue()
Example #7
Source File: runtime.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors, ) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context( template, callable_, context, *args, **_kwargs_for_callable(callable_, data) ) return context._pop_buffer().getvalue()
Example #8
Source File: runtime.py From teleport with Apache License 2.0 | 5 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors, ) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context( template, callable_, context, *args, **_kwargs_for_callable(callable_, data) ) return context._pop_buffer().getvalue()
Example #9
Source File: runtime.py From teleport with Apache License 2.0 | 5 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors, ) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context( template, callable_, context, *args, **_kwargs_for_callable(callable_, data) ) return context._pop_buffer().getvalue()
Example #10
Source File: runtime.py From mako with MIT License | 5 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors, ) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context( template, callable_, context, *args, **_kwargs_for_callable(callable_, data) ) return context._pop_buffer().getvalue()
Example #11
Source File: runtime.py From Tautulli with GNU General Public License v3.0 | 5 votes |
def _render(template, callable_, args, data, as_unicode=False): """create a Context and return the string output of the given template and template callable.""" if as_unicode: buf = util.FastEncodingBuffer(as_unicode=True) elif template.bytestring_passthrough: buf = compat.StringIO() else: buf = util.FastEncodingBuffer( as_unicode=as_unicode, encoding=template.output_encoding, errors=template.encoding_errors, ) context = Context(buf, **data) context._outputting_as_unicode = as_unicode context._set_with_template(template) _render_context( template, callable_, context, *args, **_kwargs_for_callable(callable_, data) ) return context._pop_buffer().getvalue()