From 0c0844f77c8dc2be328ca3c9233b4103db92a02d Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 29 Apr 2012 06:13:43 +0200 Subject: [PATCH] Added runhelper --- runhelper/runhelper | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 runhelper/runhelper 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)