Merge remote-tracking branch 'origin/main'

# Conflicts:
#	desktop_env/controllers/setup.py
This commit is contained in:
Timothyxxx
2024-01-15 13:51:11 +08:00
12 changed files with 356 additions and 24 deletions

View File

@@ -63,14 +63,15 @@ def execute_command():
@app.route('/setup/launch', methods=["POST"])
def launch_app():
data = request.json
command: List[str] = data.get("command", [])
shell = data.get("shell", False)
command: List[str] = data.get("command", "" if shell else [])
if isinstance(command, str):
command = shlex.split(command)
try:
subprocess.Popen(command)
return "{:} launched successfully".format(" ".join(command))
subprocess.Popen(command, shell=shell)
return "{:} launched successfully".format(command if shell else " ".join(command))
except Exception as e:
return jsonify({"status": "error", "message": str(e)}), 500

View File

@@ -5,3 +5,4 @@ git+https://github.com/moses-palmer/pynput.git@refs/pull/541/head # to make sure
requests
flask
numpy
lxml