signal_manager.tpl 628 Bytes
#!/usr/bin/env python
# -*- coding: utf_8 -*-

from webcreator.event import PySignal

class SignalManager(object):
{%- for item in config %}
{%- if "restful" in item.get("view") and item.get("view").get("restful") == False %}
    {%- for r in item.get("view").get("routes", []) %}
    action{{ r.get("name") | capitalize }} = PySignal()
    {%- endfor %}
{%- else %}
    {%- for key, value in item['view'].items() %}
    action{{ key | capitalize }}{{ item.get("name") | capitalize }} = PySignal()
    {%- endfor %}
{%- endif %}
{%- endfor %}

    def __init__(self):
        super().__init__()

signalManager = SignalManager()