Add delete script

This commit is contained in:
2024-06-30 19:39:36 +00:00
parent 41e41b3f02
commit bcef114a02
+27
View File
@@ -0,0 +1,27 @@
import sys
import shelve
if len(sys.argv) < 2:
print('Please give the note ID to delete.')
print('Example: python misc/delete.py IEGA')
exit()
else:
del_id = sys.argv[1]
print('Deleting note:', del_id)
with shelve.open('data/t0txt') as db:
if del_id not in db:
print('Not found.')
exit()
print('Contents:')
print(db[del_id])
print()
print('Enter to confirm, ctrl-c to cancel')
input()
del db[del_id]
print('done.')