fixed complex strings
This commit is contained in:
@@ -446,17 +446,11 @@ class AltiumParser:
|
||||
|
||||
|
||||
def make_complex_string(text: str, props: list[ComponentProperty]) -> str:
|
||||
text = sanitize_text(text)
|
||||
if not text.startswith("="):
|
||||
return text
|
||||
expr = text[1:]
|
||||
from app.services.designators import resolve_expression
|
||||
|
||||
mapping = {p.name: p.text for p in props}
|
||||
|
||||
def repl(m: re.Match) -> str:
|
||||
key = m.group(1)
|
||||
return mapping.get(key, "")
|
||||
|
||||
return sanitize_text(re.sub(r"['\"]([^'\"]+)['\"]", repl, expr))
|
||||
designator = mapping.get("Designator", "")
|
||||
return sanitize_text(resolve_expression(text, mapping, designator))
|
||||
|
||||
|
||||
def find_prjpcb(extract_dir: Path) -> Optional[Path]:
|
||||
|
||||
Reference in New Issue
Block a user