From 2d1f24e54eec04e76fa80616f73d61fd6f18daf7 Mon Sep 17 00:00:00 2001 From: Fred Date: Sat, 10 Aug 2013 19:45:47 +0800 Subject: [PATCH] More debugging for scripts --- lib/scripts.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/scripts.py b/lib/scripts.py index 1e8e889..4d675b8 100644 --- a/lib/scripts.py +++ b/lib/scripts.py @@ -25,6 +25,7 @@ http://github.com/FMCorz/mdk import os import shutil import stat +import logging from tools import process from config import Conf from exceptions import ScriptNotFound, ConflictInScriptName, UnsupportedScript @@ -126,17 +127,22 @@ class Scripts(object): cli = cls.find(script) if cli.endswith('.php'): dest = os.path.join(path, 'mdkscriptrun.php') + logging.debug('Copying %s to %s' % (cli, dest)) shutil.copyfile(cli, dest) cmd = '%s %s' % (C.get('php'), dest) + logging.debug('Executing %s' % (cmd)) result = process(cmd, cwd=path, **cmdkwargs) - os.remove(dest) + print result + # os.remove(dest) elif cli.endswith('.sh'): dest = os.path.join(path, 'mdkscriptrun.sh') + logging.debug('Copying %s to %s' % (cli, dest)) shutil.copyfile(cli, dest) os.chmod(dest, stat.S_IRUSR | stat.S_IXUSR) cmd = '%s' % (dest) + logging.debug('Executing %s' % (cmd)) result = process(cmd, cwd=path, **cmdkwargs) os.remove(dest) else: -- 2.11.0