mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-06-16 12:22:22 +00:00
3ab0dcb9e6
Templated hooks we almost completely useless, so we get rid of them. This allows us to get rid entirely of hook names and hook indexes, which makes the whole implementation much simpler. Hook removal (with `clear_all`) is achieved thanks to weak references.
14 lines
292 B
Python
14 lines
292 B
Python
import typing as t
|
|
|
|
from .actions import Action
|
|
from .contexts import Context
|
|
from .filters import Filter
|
|
|
|
|
|
def clear_all(context: t.Optional[str] = None) -> None:
|
|
"""
|
|
Clear both actions and filters.
|
|
"""
|
|
Action.clear_all(context=context)
|
|
Filter.clear_all(context=context)
|