MCPcopy Create free account
hub / github.com/vispy/vispy / replace

Method replace

vispy/visuals/shaders/function.py:382–399  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 15

use_appFunction · 0.80
_pyqt6.pyFile · 0.80
_pyqt4.pyFile · 0.80
_pyside6.pyFile · 0.80
_pyside2.pyFile · 0.80
_pyqt5.pyFile · 0.80
_pyside.pyFile · 0.80
_process_glsl_templateFunction · 0.80
__init__Method · 0.80
get_instance_methodMethod · 0.80
get_class_methodMethod · 0.80
decoratorMethod · 0.80

Calls 2

getMethod · 0.80
changedMethod · 0.80

Tested by 1

test_queueFunction · 0.64