cookiecutter-wuttaweb/{{ cookiecutter.repo_name }}/{{ cookiecutter.package_name }}/web/subscribers.py

17 lines
442 B
Python
Raw Permalink Normal View History

# -*- coding: utf-8; -*-
"""
Pyramid event subscribers
"""
import {{cookiecutter.package_name}}
def add_{{cookiecutter.package_name}}_to_context(event):
renderer_globals = event
renderer_globals['{{cookiecutter.package_name}}'] = {{cookiecutter.package_name}}
def includeme(config):
config.include('wuttaweb.subscribers')
config.add_subscriber(add_{{cookiecutter.package_name}}_to_context, 'pyramid.events.BeforeRender')