Use shared item axis context in role routes
This commit is contained in:
@@ -5,6 +5,11 @@ import re
|
||||
from string import Formatter
|
||||
from typing import Any, Callable
|
||||
|
||||
try:
|
||||
from . import item_axis_policy
|
||||
except ImportError: # Allows local smoke tests with top-level imports.
|
||||
import item_axis_policy
|
||||
|
||||
|
||||
HARDCORE_POSITION_FAMILY_CHOICES = [
|
||||
"any",
|
||||
@@ -847,10 +852,7 @@ def hardcore_source_position_family(subcategory: dict[str, Any], config: dict[st
|
||||
|
||||
|
||||
def hardcore_position_keys(*parts: Any, axis_values: dict[str, Any] | None = None) -> list[str]:
|
||||
text_parts = [str(part or "") for part in parts if str(part or "").strip()]
|
||||
if isinstance(axis_values, dict):
|
||||
text_parts.extend(str(value or "") for value in axis_values.values() if str(value or "").strip())
|
||||
text = " ".join(text_parts).lower()
|
||||
text = item_axis_policy.context_text(*parts, axis_values=axis_values)
|
||||
if not text:
|
||||
return []
|
||||
keys: list[str] = []
|
||||
|
||||
Reference in New Issue
Block a user