summaryrefslogtreecommitdiff
path: root/htmtl/modifier.py
diff options
context:
space:
mode:
Diffstat (limited to 'htmtl/modifier.py')
-rw-r--r--htmtl/modifier.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/htmtl/modifier.py b/htmtl/modifier.py
new file mode 100644
index 0000000..a771cca
--- /dev/null
+++ b/htmtl/modifier.py
@@ -0,0 +1,19 @@
+from abc import abstractmethod, ABC
+from typing import Any
+
+
+class Modifier(ABC):
+ name: str
+
+ @abstractmethod
+ def modify(self, value: Any, opts: list[Any]) -> Any:
+ pass
+
+
+def modifier_name(name: str):
+ def wrapper(cls: type[Modifier]):
+ cls.name = name
+
+ return cls
+
+ return wrapper \ No newline at end of file