diff --git a/runhelper/runhelper b/runhelper/runhelper new file mode 100644 index 0000000..ba3b1cc --- /dev/null +++ b/runhelper/runhelper @@ -0,0 +1,19 @@ +#!/usr/bin/python + +import json, subprocess +from optparse import OptionParser + +parser = OptionParser() +(options, args) = parser.parse_args() + +pr = subprocess.Popen(args[0], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +data = pr.communicate() +pr.wait() + +obj = { + 'stdout': data[0], + 'stderr': data[1], + 'return': pr.returncode +} + +print json.dumps(obj)