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)
| 230 | |
| 231 | |
| 232 | def 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 | |
| 244 | def wrap_braces(value: str) -> str: |
no outgoing calls
no test coverage detected