Skip to content

API turboframe.recent

rafageist edited this page Dec 4, 2026 · 4 revisions

turboframe.recent

Source: turboframe/recent.py. Generated from the code of TurboFrame 0.3.0 by tools/wiki_api.py.

The folders and files opened lately, newest first, in the application's store.

Recent(store) keeps, under the store's "recent", a list of paths per kind ({"folders": [...], "files": [...]}): add puts a path first (once, resolved), forget takes it out, entries reads those still on disk. Only real paths are kept; one that no longer exists is left out when the list is read. The store is any object with load() -> dict and save(dict) (turboframe.config.JsonStore).

Contents

KINDS, LIMIT, Recent

KINDS

('folders', 'files')

LIMIT

12

class Recent

class Recent
Recent(store: Any, key: str = 'recent', *, limit: int = 12, kinds: tuple[str, ...] = ('folders', 'files'))

The recent paths of kinds in store[key], at most limit of each.

  • stored() -> dict[str, list[str]]: Every kind's list as kept, without what is not a path's text.
  • entries(kind: str) -> list[Path]: The kind ("folders", "files") still on disk, newest first.
  • add(kind: str, path: Path) -> None: path first in its list (and only once), resolved.
  • forget(kind: str, path: Path) -> None: path out of its list (as it is listed: entries gives it).

Clone this wiki locally