File: registries.py

package info (click to toggle)
python-persisting-theory 1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 196 kB
  • sloc: python: 423; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 476 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os, sys

sys.path.append(os.path.dirname(os.path.dirname(__file__)))

from persisting_theory import Registry


class CallbacksRegistry(Registry):
    """
    Allow your apps to register callbacks
    """

    # the package where the registry will try to find callbacks in each app
    look_into = "callbacks_registry"


callbacks_registry = CallbacksRegistry()

APPS = (
    "app1",
    "app2",
)
# Trigger autodiscovering process
callbacks_registry.autodiscover(APPS)