PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/web/wiki/macros/utils.py

https://bitbucket.org/prologic/circuits/
Python | 15 lines | 5 code | 5 blank | 5 comment | 2 complexity | e3d85eefe1872e1a28148827e2950d1c MD5 | raw file
 1"""Utils macros
 2
 3Utility macros
 4"""
 5
 6from inspect import getdoc
 7
 8
 9def macros(macro, environ, *args, **kwargs):
10    """Return a list of available macros"""
11
12    macros = environ["macros"].items()
13    s = "\n".join(["== %s ==\n%s\n" % (k, getdoc(v)) for k, v in macros])
14
15    return environ["parser"].generate(s, environ=environ)