MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / TemplatePlugin

Class TemplatePlugin

thirdparty/bottle/bottle.py:2416–2434  ·  view source on GitHub ↗

This plugin applies the :func:`view` decorator to all routes with a `template` config parameter. If the parameter is a tuple, the second element must be a dict with additional options (e.g. `template_engine`) or default variables for the template.

Source from the content-addressed store, hash-verified

2414
2415
2416class TemplatePlugin(object):
2417 """ This plugin applies the :func:`view` decorator to all routes with a
2418 `template` config parameter. If the parameter is a tuple, the second
2419 element must be a dict with additional options (e.g. `template_engine`)
2420 or default variables for the template. """
2421 name = 'template'
2422 api = 2
2423
2424 def setup(self, app):
2425 app.tpl = self
2426
2427 def apply(self, callback, route):
2428 conf = route.config.get('template')
2429 if isinstance(conf, (tuple, list)) and len(conf) == 2:
2430 return view(conf[0], **conf[1])(callback)
2431 elif isinstance(conf, str):
2432 return view(conf)(callback)
2433 else:
2434 return callback
2435
2436
2437#: Not a plugin, but part of the plugin API. TODO: Find a better place.

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…