gallery.accords-library.com/server/szurubooru/rest/middleware.py

15 lines
344 B
Python
Raw Normal View History

2017-04-24 21:30:53 +00:00
from typing import List, Callable
from szurubooru.rest.context import Context
pre_hooks = [] # type: List[Callable[[Context], None]]
post_hooks = [] # type: List[Callable[[Context], None]]
def pre_hook(handler: Callable) -> None:
pre_hooks.append(handler)
def post_hook(handler: Callable) -> None:
post_hooks.insert(0, handler)