YAML Loader with `!include` constructor.
| 17 | f.write(log + "\n") |
| 18 | |
| 19 | class Loader(yaml.SafeLoader): |
| 20 | """YAML Loader with `!include` constructor.""" |
| 21 | |
| 22 | def __init__(self, stream: IO) -> None: |
| 23 | """Initialise Loader.""" |
| 24 | |
| 25 | try: |
| 26 | self._root = os.path.split(stream.name)[0] |
| 27 | except AttributeError: |
| 28 | self._root = os.path.curdir |
| 29 | |
| 30 | super().__init__(stream) |
| 31 | |
| 32 | def construct_include(loader: Loader, node: yaml.Node) -> Any: |
| 33 | """Include file referenced at node.""" |
nothing calls this directly
no outgoing calls
no test coverage detected