(self, old_filename: str, new_filename: str)
| 62 | LOGGER.error(str(e)) |
| 63 | |
| 64 | def rename(self, old_filename: str, new_filename: str) -> None: |
| 65 | if not self.config: |
| 66 | return |
| 67 | |
| 68 | state = self.config.read_toml( |
| 69 | RecentFilesState, fallback=RecentFilesState() |
| 70 | ) |
| 71 | if old_filename in state.files: |
| 72 | state.files.remove(old_filename) |
| 73 | state.files.insert(0, new_filename) |
| 74 | state.files = state.files[: self.MAX_FILES] |
| 75 | |
| 76 | self.config.write_toml(state) |
| 77 | |
| 78 | def get_recents( |
| 79 | self, directory: pathlib.Path | None = None |
no test coverage detected