MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _prop_text

Method _prop_text

SLiCAP/schematic/component_item.py:587–604  ·  view source on GitHub ↗

Fallback plain text for a property, honouring prop_display settings. For {…} expressions the braces are stripped so the raw expression is shown when LaTeX rendering is unavailable. Returns "" when nothing should be shown.

(self, key: str)

Source from the content-addressed store, hash-verified

585 return self.params.get(key, "")
586
587 def _prop_text(self, key: str) -> str:
588 """
589 Fallback plain text for a property, honouring prop_display settings.
590 For {…} expressions the braces are stripped so the raw expression is
591 shown when LaTeX rendering is unavailable.
592 Returns "" when nothing should be shown.
593 """
594 show_val, show_name = self.prop_display.get(key, (False, False))
595 if not show_val:
596 return ""
597 val = self._prop_value(key)
598 if not val:
599 return ""
600 # strip braces for plain-text display of expressions
601 display_val = val.strip()
602 if display_val.startswith("{") and display_val.endswith("}"):
603 display_val = display_val[1:-1].strip()
604 return f"{key} = {display_val}" if show_name else display_val
605
606 # ── label management ──────────────────────────────────────────────────────
607

Callers 2

update_labelsMethod · 0.95
_latex_labelFunction · 0.80

Calls 1

_prop_valueMethod · 0.95

Tested by

no test coverage detected