vscode: get no-dbg args from launch.json

This commit is contained in:
ed 2021-04-11 17:22:42 +02:00
parent c14b17bfaf
commit a2657887cc
3 changed files with 29 additions and 3 deletions

2
.vscode/launch.json vendored
View file

@ -14,6 +14,8 @@
"-emp", "-emp",
"-e2dsa", "-e2dsa",
"-e2ts", "-e2ts",
"-mtp",
".bpm=f,bin/mtag/audio-bpm.py",
"-a", "-a",
"ed:wark", "ed:wark",
"-v", "-v",

26
.vscode/launch.py vendored Normal file
View file

@ -0,0 +1,26 @@
# takes arguments from launch.json
# is used by no_dbg in tasks.json
# launches 10x faster than mspython debugpy
# and is stoppable with ^C
import os
import sys
sys.path.insert(0, os.getcwd())
import jstyleson
from copyparty.__main__ import main as copyparty
with open(".vscode/launch.json", "r") as f:
tj = f.read()
oj = jstyleson.loads(tj)
argv = oj["configurations"][0]["args"]
try:
copyparty(argv)
except SystemExit as ex:
if ex.code:
raise
print("\n\033[32mokke\033[0m")
sys.exit(1)

4
.vscode/tasks.json vendored
View file

@ -9,9 +9,7 @@
{ {
"label": "no_dbg", "label": "no_dbg",
"type": "shell", "type": "shell",
"command": "${config:python.pythonPath} -m copyparty -ed -emp -e2dsa -e2ts -a ed:wark -v srv::r:aed:cnodupe -v dist:dist:r ;exit 1" "command": "${config:python.pythonPath} .vscode/launch.py"
// -v ~/Music/mt:mt:r:cmtp=.bpm=~/dev/copyparty/bin/mtag/audio-bpm.py:cmtp=key=~/dev/copyparty/bin/mtag/audio-key.py:ce2tsr
// -v ~/Music/mt:mt:r:cmtp=.bpm=~/dev/copyparty/bin/mtag/audio-bpm.py:ce2tsr
} }
] ]
} }