history module

class pdbstore.store.history.History(store: Store)

Bases: object

Manage history.txt content

add(transaction: Transaction) None

Register a new ‘add’ operation

Parameters:

transaction – The transaction to be added.

Raise:
WriteFileError:

Failed to update history file

delete(transaction: Transaction, delete_id: str) None

Register a new ‘del’ operation

Parameters:
  • transaction – The deleted transaction.

  • delete_id – The transaction id associated to new history entry.

Raise:
WriteFileError:

Failed to update history file.

file_exists() bool

Determine whether the history file exists or not

Returns:

True if the file exists, else False

reset() None

Reset to the transactions list to None.

property transactions: List[Transaction]

Get the transactions list.