Return a list of all fonts matching any of the extensions, found recursively under the directory.
(directory, extensions)
| 189 | |
| 190 | |
| 191 | def list_fonts(directory, extensions): |
| 192 | """ |
| 193 | Return a list of all fonts matching any of the extensions, found |
| 194 | recursively under the directory. |
| 195 | """ |
| 196 | extensions = ["." + ext for ext in extensions] |
| 197 | return [os.path.join(dirpath, filename) |
| 198 | # os.walk ignores access errors, unlike Path.glob. |
| 199 | for dirpath, _, filenames in os.walk(directory) |
| 200 | for filename in filenames |
| 201 | if Path(filename).suffix.lower() in extensions] |
| 202 | |
| 203 | |
| 204 | def win32FontDirectory(): |
no test coverage detected
searching dependent graphs…