def view(path):
    def _decorator(func):
        @functools.wraps(func)
        def _wrapper(*args, **kw):
            _log('call @view: %s' % path)
            r = func(*args, **kw)
            if isinstance(r, dict):
                return Template(path, **r)
            return r
        return _wrapper
    return _decorator
A view decorator that render a view by dict.
dataset/ETHPy150Open michaelliao/transwarp/transwarp/web.py/view