MCPcopy
hub / github.com/plotly/dash / replace_file

Function replace_file

tests/integration/devtools/test_hot_reload.py:21–30  ·  view source on GitHub ↗
(filename, new_content)

Source from the content-addressed store, hash-verified

19
20
21def replace_file(filename, new_content):
22 path = os.path.join(os.path.dirname(__file__), "hr_assets", filename)
23 with open(path, "r+") as fp:
24 sleep(1) # ensure a new mod time
25 old_content = fp.read()
26 fp.truncate(0)
27 fp.seek(0)
28 fp.write(new_content)
29
30 return path, old_content
31
32
33def test_dvhr001_hot_reload(dash_duo_mp):

Callers 1

test_dvhr001_hot_reloadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…