added(py): command to edit settings

This commit is contained in:
quenousimporte 2023-09-18 07:58:43 +02:00
parent afd8c2de24
commit a23035ce18
1 changed files with 5 additions and 0 deletions

View File

@ -107,6 +107,8 @@ while not (command == "quit" or command == "exit" or command == "q"):
elif command[0:7] == "export ":
action = "export"
command = command[7:]
elif command == "settings":
action = "settings"
try:
index = int(command)
@ -130,6 +132,9 @@ while not (command == "quit" or command == "exit" or command == "q"):
elif action == "export":
if note:
writetextfile("data/" + note["title"] + ".md", note["content"])
elif action == "settings":
subprocess.call(settings["commands"]["editor"] + ["settings.json"])
settings = json.loads(readtextfile("settings.json"))
elif note and not action == "grep":
editnote(note)
else: