Begin implementing staged undo system

This commit is contained in:
Xevion
2021-08-25 04:55:10 -05:00
parent 11c63995b9
commit 3f79bc401b
4 changed files with 86 additions and 21 deletions

20
bulk_reminders/undo.py Normal file
View File

@@ -0,0 +1,20 @@
import json
import os
stages = []
def load() -> None:
"""Load data from the undo history file"""
with open('history.json', 'r') as history:
stages = json.load(history)
def save() -> None:
"""Save data to the undo history file."""
with open('history.json', 'w') as history:
stages = json.dump(history)
if os.path.exists('history.json'):
load()