aboutsummaryrefslogtreecommitdiff
path: root/scripts/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/utils.py')
-rw-r--r--scripts/utils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/utils.py b/scripts/utils.py
index 742aec5..e06bdbb 100644
--- a/scripts/utils.py
+++ b/scripts/utils.py
@@ -30,15 +30,18 @@ def build_symbol_map():
def callsubprocess(process_name, process, show_output = True,
return_output = False, env=os.environ, allowed_exit_codes = [0],
- allow_all_exit_codes = False):
+ allow_all_exit_codes = False, stdin = None):
sprc = subprocess.Popen(process, stdout = subprocess.PIPE,
- stderr = subprocess.STDOUT, env = env)
+ stderr = subprocess.STDOUT, stdin = subprocess.PIPE, env = env)
try:
os.mkdir(os.path.join(sf(conf.log_folder), process_name))
except OSError:
pass
+ if stdin != None:
+ sprc.stdin.write(bytes(stdin, sys.getdefaultencoding()))
+
rtn = []
with open(os.path.join(sf(conf.log_folder),
process_name, time.strftime("%y-%m-%d-%H-%M-%S") + ".log"),