1 """Custom yaml object types."""
3 from __future__
import annotations
5 from dataclasses
import dataclass
8 import voluptuous
as vol
9 from voluptuous.schema_builder
import _compile_scalar
14 """Wrapper class to be able to add attributes on a list."""
16 __slots__ = (
"__config_file__",
"__line__")
23 """Wrapper class to be able to add attributes on a string."""
25 __slots__ = (
"__config_file__",
"__line__")
31 """Needed because vol.Schema.compile does not handle str subclasses."""
32 return _compile_scalar(self)
36 """Wrapper class to be able to add attributes on a dict."""
38 __slots__ = (
"__config_file__",
"__line__")
44 @dataclass(slots=True, frozen=True)
46 """Input that should be substituted."""
51 def from_node(cls, loader: yaml.Loader, node: yaml.nodes.Node) -> Input:
52 """Create a new placeholder from a node."""
53 return cls(node.value)
Any __voluptuous_compile__(self, vol.Schema schema)