cookiecutter-wuttaweb/{{ cookiecutter.repo_name }}/{{ cookiecutter.package_name }}/web/subscribers.py
Lance Edgar 46b33a622f initial template for app based on wuttaweb
with e.g. `poser install` command
2024-11-26 11:16:09 -06:00

17 lines
442 B
Python

# -*- 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')