Find a static file with the given path using all enabled finders. If ``find_all`` is ``False`` (default), return the first matching absolute path (or ``None`` if no match). Otherwise return a list.
(path, find_all=False)
| 275 | |
| 276 | |
| 277 | def find(path, find_all=False): |
| 278 | """ |
| 279 | Find a static file with the given path using all enabled finders. |
| 280 | |
| 281 | If ``find_all`` is ``False`` (default), return the first matching |
| 282 | absolute path (or ``None`` if no match). Otherwise return a list. |
| 283 | """ |
| 284 | searched_locations[:] = [] |
| 285 | matches = [] |
| 286 | for finder in get_finders(): |
| 287 | result = finder.find(path, find_all=find_all) |
| 288 | if not find_all and result: |
| 289 | return result |
| 290 | if not isinstance(result, (list, tuple)): |
| 291 | result = [result] |
| 292 | matches.extend(result) |
| 293 | if matches: |
| 294 | return matches |
| 295 | # No match. |
| 296 | return [] if find_all else None |
| 297 | |
| 298 | |
| 299 | def get_finders(): |
nothing calls this directly
no test coverage detected