From 4852d27da77744a4723dfdc0f86c9d23b4cde421 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 14 Sep 2023 10:07:37 +0200 Subject: [PATCH] python tool: handle notes:// protocol (windows) --- cli/python/app.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli/python/app.py b/cli/python/app.py index 43f4e12..f4becff 100644 --- a/cli/python/app.py +++ b/cli/python/app.py @@ -5,6 +5,10 @@ import urllib.parse import os import sys +abspath = os.path.abspath(__file__) +dname = os.path.dirname(abspath) +os.chdir(dname) + def listnotes(filter = ""): cnt = 0 for i in reversed(range(len(data))): @@ -66,6 +70,9 @@ data = json.loads(readtextfile("data/backupdata.json")) command = "" if len(sys.argv) > 1: command = sys.argv[1] + if command.startswith("notes://"): + command = urllib.parse.unquote(command[8:-1]) + while not (command == "quit" or command == "exit" or command == "q"):