Detects files on the local disk.
| 38 | |
| 39 | |
| 40 | class LocalFileDetector(FileDetector): |
| 41 | """Detects files on the local disk.""" |
| 42 | |
| 43 | def is_local_file(self, *keys: str | float) -> str | None: |
| 44 | file_path = "".join(keys_to_typing(keys)) |
| 45 | |
| 46 | with suppress(OSError): |
| 47 | if Path(file_path).is_file(): |
| 48 | return file_path |
| 49 | return None |