summaryrefslogtreecommitdiff
path: root/htmtl/modifier.py
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2025-01-02 01:30:23 +0200
committerAsko Nõmm <asko@nmm.ee>2025-01-02 01:30:23 +0200
commit689fe2613765de71101214a482c928cfdb1b2be6 (patch)
tree53ff6f9a092caee32e5c600bccf5ee546bd8bc20 /htmtl/modifier.py
parent5e08a8b2f9258ae1f0aca7e3ad044b6360e07458 (diff)
Clean up some naming usages and things
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