added utils

This commit is contained in:
2025-04-11 16:15:19 +03:00
parent 5aa151805f
commit 7704f0dd5c
3 changed files with 5 additions and 5 deletions

View File

@ -15,6 +15,8 @@ from typing import (
from option import NONE, Err, Ok, Option, Result, Some
from utils.utils import indent
C = TypeVar("C", default=str)
V = TypeVar("V", default=str)
@ -54,11 +56,6 @@ class Tags(Generic[C, V]):
return "\n".join(lines)
def indent(text: str, spaces: int = 2) -> str:
prefix = " " * spaces
return "\n".join(prefix + line for line in text.splitlines())
@dataclass
class QuizTask(Generic[C, V]):
question: str

0
utils/__init__.py Normal file
View File

3
utils/utils.py Normal file
View File

@ -0,0 +1,3 @@
def indent(text: str, spaces: int = 2) -> str:
prefix = " " * spaces
return "\n".join(prefix + line for line in text.splitlines())