Set verbatim code replacement It is strongly recommended to use function['$foo'] = 'bar' where possible because template variables are less likely to changed than the code itself in future versions of vispy. Parameters ---------- str1 : str
(self, str1, str2)
| 380 | return list(self._static_vars.keys()) + [arg[0] for arg in self.args] |
| 381 | |
| 382 | def replace(self, str1, str2): |
| 383 | """Set verbatim code replacement |
| 384 | |
| 385 | It is strongly recommended to use function['$foo'] = 'bar' where |
| 386 | possible because template variables are less likely to changed |
| 387 | than the code itself in future versions of vispy. |
| 388 | |
| 389 | Parameters |
| 390 | ---------- |
| 391 | str1 : str |
| 392 | String to replace |
| 393 | str2 : str |
| 394 | String to replace str1 with |
| 395 | """ |
| 396 | if str2 != self._replacements.get(str1, None): |
| 397 | self._replacements[str1] = str2 |
| 398 | self.changed(code_changed=True) |
| 399 | # self._last_changed = time.time() |
| 400 | |
| 401 | # Private methods |
| 402 |