MCPcopy
hub / github.com/pallets/werkzeug / _find_watchdog_paths

Function _find_watchdog_paths

src/werkzeug/_reloader.py:119–140  ·  view source on GitHub ↗

Find paths for the stat reloader to watch. Looks at the same sources as the stat reloader, but watches everything under directories instead of individual files.

(
    extra_files: set[str], exclude_patterns: set[str]
)

Source from the content-addressed store, hash-verified

117
118
119def _find_watchdog_paths(
120 extra_files: set[str], exclude_patterns: set[str]
121) -> t.Iterable[str]:
122 """Find paths for the stat reloader to watch. Looks at the same
123 sources as the stat reloader, but watches everything under
124 directories instead of individual files.
125 """
126 dirs = set()
127
128 for name in chain(list(sys.path), extra_files):
129 name = os.path.abspath(name)
130
131 if os.path.isfile(name):
132 name = os.path.dirname(name)
133
134 dirs.add(name)
135
136 for name in _iter_module_paths():
137 dirs.add(os.path.dirname(name))
138
139 _remove_by_pattern(dirs, exclude_patterns)
140 return _find_common_roots(dirs)
141
142
143def _find_common_roots(paths: t.Iterable[str]) -> t.Iterable[str]:

Callers 1

run_stepMethod · 0.85

Calls 5

_iter_module_pathsFunction · 0.85
_remove_by_patternFunction · 0.85
_find_common_rootsFunction · 0.85
listFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…