MCPcopy Index your code
hub / github.com/plotly/dash / walk

Function walk

dash/_watch.py:11–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 watched = collections.defaultdict(lambda: -1.0)
10
11 def walk():
12 walked = []
13 for folder in folders:
14 for current, _, files in os.walk(folder):
15 for f in files:
16 if pattern and not pattern.search(f):
17 continue
18 path = os.path.join(current, f)
19
20 info = os.stat(path)
21 new_time = info.st_mtime
22
23 if new_time > watched[path] > 0:
24 on_change(path, new_time, False)
25
26 watched[path] = new_time
27 walked.append(path)
28
29 # Look for deleted files
30 for w in [x for x in watched.keys() if x not in walked]:
31 del watched[w]
32 on_change(w, -1, True)
33
34 while True:
35 walk()

Callers 1

watchFunction · 0.85

Calls 4

on_changeFunction · 0.85
walkMethod · 0.80
keysMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…