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