feat(py): keep a local timestamped copy of edited note before sending to server

This commit is contained in:
quenousimporte 2023-09-21 09:40:56 +02:00
parent 1446be8ba6
commit 0c7fa3d714
1 changed files with 1 additions and 0 deletions

View File

@ -48,6 +48,7 @@ def editnote(note):
newcontent = readtextfile("data/" + filename(note) )
if newcontent != content:
subprocess.call(["cp", "data/" + filename(note), "data/" + filename(note) + str(time.time())])
subprocess.call(settings["commands"]["diff"] + ["data/" + filename(note) + ".bak", "data/" + filename(note)])
note["content"] = newcontent
data.remove(note)