From 62214c2a889fd21f0e5782cdc05996bf0101c6c4 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 22 Nov 2018 18:44:19 +0800 Subject: [PATCH] Update plugins.py --- route/plugins.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/route/plugins.py b/route/plugins.py index b7e49151a..4c4a3e95f 100644 --- a/route/plugins.py +++ b/route/plugins.py @@ -127,18 +127,19 @@ def setting(): @plugins.route('/run', methods=['POST', 'GET']) def run(): - name = request.form.get('name', '') func = request.form.get('func', '') args = request.form.get('args', '') + script = request.form.get('script', 'index') py = 'python ' + public.getRunDir() + '/' + __plugin_name + '/' + name if args == '': - py = py + '/index.py' + ' ' + func + py = py + '/' + script + '.py' + ' ' + func else: - py = py + '/index.py' + ' ' + func + ' ' + args + py = py + '/' + script + '.py' + ' ' + func + ' ' + args data = public.execShell(py) + if data[1].strip() == '': return public.returnJson(True, "OK", data[0].strip()) return public.returnJson(False, data[1].strip())