Return an iterable over the named resources within the package. The iterable returns :class:`str` resources (e.g. files). The iterable does not recurse into subdirectories.
(anchor, *path_names)
| 46 | |
| 47 | |
| 48 | def contents(anchor, *path_names): |
| 49 | """Return an iterable over the named resources within the package. |
| 50 | |
| 51 | The iterable returns :class:`str` resources (e.g. files). |
| 52 | The iterable does not recurse into subdirectories. |
| 53 | """ |
| 54 | warnings.warn( |
| 55 | "importlib.resources.contents is deprecated. " |
| 56 | "Use files(anchor).iterdir() instead.", |
| 57 | DeprecationWarning, |
| 58 | stacklevel=1, |
| 59 | ) |
| 60 | return (resource.name for resource in _get_resource(anchor, path_names).iterdir()) |
| 61 | |
| 62 | |
| 63 | def _get_encoding_arg(path_names, encoding): |
nothing calls this directly
no test coverage detected
searching dependent graphs…