python tool: handle notes:// protocol (windows)

This commit is contained in:
quenousimporte 2023-09-14 10:07:37 +02:00
parent 9e31b46e82
commit 4852d27da7
1 changed files with 7 additions and 0 deletions

View File

@ -5,6 +5,10 @@ import urllib.parse
import os import os
import sys import sys
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)
def listnotes(filter = ""): def listnotes(filter = ""):
cnt = 0 cnt = 0
for i in reversed(range(len(data))): for i in reversed(range(len(data))):
@ -66,6 +70,9 @@ data = json.loads(readtextfile("data/backupdata.json"))
command = "" command = ""
if len(sys.argv) > 1: if len(sys.argv) > 1:
command = 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"): while not (command == "quit" or command == "exit" or command == "q"):