punchbowl.data.history#
Classes#
Representation of the history of edits done to a PUNCH data object. |
Module Contents#
- class punchbowl.data.history.History#
Representation of the history of edits done to a PUNCH data object.
- _entries: list[HistoryEntry] = []#
- add_entry(entry: HistoryEntry) None#
Add an entry to the History log.
- Parameters:
entry (HistoryEntry) – A HistoryEntry object to add to the History log
- Return type:
None
- add_now(source: str, comment: str) None#
Add a new history entry at the current time.
- Parameters:
source (str) – what module of the code the history entry originates from
comment (str) – a note of what the history comment means
- Return type:
None
- clear() None#
Clear all the history entries so the History is blank.
- Return type:
None
- __getitem__(index: int) HistoryEntry#
Given an index, return the requested HistoryEntry.
- Parameters:
index (int) – numerical index of the history entry, increasing number typically indicates an older entry
- Returns:
history at specified index
- Return type:
- most_recent() HistoryEntry#
Get the most recent HistoryEntry, i.e. the youngest.
- Returns:
returns HistoryEntry that is the youngest
- Return type:
- __len__() int#
Get length.
- __str__() str#
Format a string combining all the history entries.
- Returns:
a combined record of the history entries
- Return type:
str
- __next__() HistoryEntry#
Get next.