confighelper: avoid direct import of JinjaTemplate
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import copy
|
||||
import re
|
||||
from enum import Enum, Flag, auto
|
||||
from dataclasses import dataclass
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from .utils import ServerError, Sentinel
|
||||
from .utils import json_wrapper as jsonw
|
||||
|
||||
@@ -159,6 +160,19 @@ class KlippyState(ExtendedEnum):
|
||||
def startup_complete(self) -> bool:
|
||||
return self.value > 2
|
||||
|
||||
class RenderableTemplate(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def __str__(self) -> str:
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def render(self, context: Dict[str, Any] = {}) -> str:
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
async def render_async(self, context: Dict[str, Any] = {}) -> str:
|
||||
...
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class APIDefinition:
|
||||
endpoint: str
|
||||
|
Reference in New Issue
Block a user