diff options
author | jonathan vanasco <jonathan@2xlp.com> | 2015-03-11 12:24:34 -0400 |
---|---|---|
committer | jonathan vanasco <jonathan@2xlp.com> | 2015-03-11 12:24:34 -0400 |
commit | 33879f782bf59438f4e9c224139c59f28c5b671a (patch) | |
tree | 58ad8f83fec947c9d24c7bd677a5a4033eca559d | |
parent | b6d0479034e4f379576caa6eb9ef3e32369c333f (diff) | |
download | mako-33879f782bf59438f4e9c224139c59f28c5b671a.tar.gz |
added `Template.list_defs`
-rw-r--r-- | mako/template.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mako/template.py b/mako/template.py index fb61062..2adf0f6 100644 --- a/mako/template.py +++ b/mako/template.py @@ -473,6 +473,10 @@ class Template(object): return DefTemplate(self, getattr(self.module, "render_%s" % name)) + def list_defs(self): + """returns a list of defs in the template""" + return [i[7:] for i in dir(self.module) if i[:7] == 'render_'] + def _get_def_callable(self, name): return getattr(self.module, "render_%s" % name) |