diff --git a/Quizard.py b/Quizard.py index abdc84d..cbed6f7 100644 --- a/Quizard.py +++ b/Quizard.py @@ -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 diff --git a/utils/__init__.py b/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/utils/utils.py b/utils/utils.py new file mode 100644 index 0000000..8267b14 --- /dev/null +++ b/utils/utils.py @@ -0,0 +1,3 @@ +def indent(text: str, spaces: int = 2) -> str: + prefix = " " * spaces + return "\n".join(prefix + line for line in text.splitlines())