gui.settings.add_recent(settings, root)
Put a repository at the top of the recent list.
Parameters
| settings |
Settings |
The current settings. |
required |
| root |
Path | str |
The repository that was opened. It is stored as an absolute, resolved path, so . and a trailing slash do not make duplicates. |
required |
Returns
| Settings |
Settings |
A copy whose recent list starts with root, without duplicates and at most 10 entries long. |
Examples
from spotregen.gui.settings import Settings, add_recent
settings = add_recent(add_recent(Settings(), "/a"), "/b")
print(add_recent(settings, "/a").recent)