INNER CODE UNIT · Python
append_history
Tiger3807861189/J-Space-Cognition-Suite-V3.6 · j-space/scripts/jspace.py:291
def append_history(book, hist=None):
if hist is None:
hist = read_history()
hist.append(
{
"t": int(time.time()),
"next": one(book, "Next"),
"verified": len(book["Verified"]),
"open": len(book["Open"]),
}
)
hist = hist[-20:]
problem = atomic_write_text(HISTORY, json.dumps(hist))
if problem:
print("WARNING: recent seam history was not saved — " + problem, file=sys.stderr)
return hist