mirror of
https://github.com/Xevion/bulk-reminders.git
synced 2025-12-10 06:06:40 -06:00
Begin implementing staged undo system
This commit is contained in:
20
bulk_reminders/undo.py
Normal file
20
bulk_reminders/undo.py
Normal 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()
|
||||
Reference in New Issue
Block a user