Coverage for kwai/core/template/template_engine.py: 100%
4 statements
« prev ^ index » next coverage.py v7.3.0, created at 2023-09-05 17:55 +0000
« prev ^ index » next coverage.py v7.3.0, created at 2023-09-05 17:55 +0000
1"""Module that defines an interface for a template engine."""
2from abc import abstractmethod
4from .template import Template
7class TemplateNotFoundException(Exception):
8 """Raised when a template cannot be found."""
11class TemplateEngine:
12 """Interface for a template engine."""
14 @abstractmethod
15 def create(self, template_file_path: str, lang: str = "nl") -> Template:
16 """Create a template from the given file path.
18 When the template cannot be found, a TemplateNotFoundException should be raised.
19 """
20 raise NotImplementedError