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

Function strip_braces

SLiCAP/schematic/component_item.py:232–241  ·  view source on GitHub ↗

Remove a single pair of surrounding {…} braces, if present. Parameter values/expressions are stored and edited *without* braces — the braces are a netlist-syntax detail the program adds, never something the user types (see wrap_braces).

(value: str)

Source from the content-addressed store, hash-verified

230
231
232def strip_braces(value: str) -> str:
233 """Remove a single pair of surrounding {…} braces, if present.
234
235 Parameter values/expressions are stored and edited *without* braces — the
236 braces are a netlist-syntax detail the program adds, never something the
237 user types (see wrap_braces)."""
238 s = value.strip()
239 if s.startswith("{") and s.endswith("}"):
240 return s[1:-1].strip()
241 return s
242
243
244def wrap_braces(value: str) -> str:

Callers 4

_rebuild_paramsMethod · 0.85
applyMethod · 0.85
_current_valueMethod · 0.85
applyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected