Ejemplo n.º 1
0
def nemo(str, debug=False):
    if debug: print "[Debug]---------  %s --------------[Debug]\n" % filename

    result = NemoParser(debug=debug).parse(str)

    if debug: print "\n[Debug]---------  Result --------------[Debug]"
    print result

    # Return Nothing so mako won't render a result
    return ''
Ejemplo n.º 2
0
def render(s, params={}):
    r"""
    render(s, params={})

    Returns a rendering result of template s with parameters params.
    The result string is an unicode string.

    >>> render('%img src="images/mrfoobar.jpg" alt="Mr. FooBar"')
    u'\n<img src="images/mrfoobar.jpg" alt="Mr. FooBar" />'
    """

    nemo = NemoParser(debug=False).parse
    return Template(s, preprocessor=nemo).render_unicode(**params)
Ejemplo n.º 3
0
def nemo(a_string):
    """ Hook for Mako pre-processing """
    return NemoParser().parse(a_string)
Ejemplo n.º 4
0
def nemo(str):
    print "---------  %s --------------" % filename
    # Return a result to Mako which will then render the string
    return NemoParser(debug=False).parse(str)
Ejemplo n.º 5
0
def nemo_render(str, debug=False):
    return NemoParser(debug=debug).parse(str)
Ejemplo n.º 6
0
def nemo(str, debug=False):
    NemoParser(debug=debug).parse(str)
    # Return Nothing so mako won't render a result
    return ''