MCPcopy
hub / github.com/marimo-team/marimo / rename

Method rename

marimo/_server/recents.py:64–76  ·  view source on GitHub ↗
(self, old_filename: str, new_filename: str)

Source from the content-addressed store, hash-verified

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

Callers 5

__Function · 0.45
_Function · 0.45
_Function · 0.45
build_dfFunction · 0.45

Calls 5

RecentFilesStateClass · 0.85
read_tomlMethod · 0.80
write_tomlMethod · 0.80
removeMethod · 0.65
insertMethod · 0.45

Tested by

no test coverage detected