Extract item template metadata policy
This commit is contained in:
@@ -10,11 +10,17 @@ from __future__ import annotations
|
||||
import ast
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
import category_template_metadata as template_metadata_policy # noqa: E402
|
||||
|
||||
POOL_DEFINITION_KEYS = ("scene_pools", "expression_pools", "composition_pools")
|
||||
POOL_REFERENCE_KEYS = {
|
||||
"scene_pool": "scene_pools",
|
||||
@@ -187,6 +193,9 @@ def _template_axis_errors(path: str, node: dict[str, Any]) -> list[tuple[str, st
|
||||
or template.get("name")
|
||||
or ""
|
||||
).strip()
|
||||
metadata = template_metadata_policy.template_metadata(template)
|
||||
for issue in template_metadata_policy.template_metadata_errors(metadata):
|
||||
errors.append((template_path, issue))
|
||||
elif isinstance(template, str):
|
||||
template_text = template
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user