aboutsummaryrefslogtreecommitdiff
path: root/scripts/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/utils.py')
-rw-r--r--scripts/utils.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/scripts/utils.py b/scripts/utils.py
index 9c83065..0d7f67a 100644
--- a/scripts/utils.py
+++ b/scripts/utils.py
@@ -57,16 +57,12 @@ def build_conf_map():
def callsubprocess(process_name, process, show_output = True, regular = "",
env=os.environ):
- try:
- os.mkdir(sf(conf.log_folder))
- except OSError:
- pass
-
sprc = subprocess.Popen(process, stdout = subprocess.PIPE, env = env)
rtn = ""
- with open(os.path.join(sf(conf.log_folder), process_name + ".log"), "a") as f:
- f.write("::" + time.strftime("%y-%m-%d-%H-%M-%S") + "::\n")
+ with open(os.path.join(sf(conf.log_folder),
+ process_name + '-' + time.strftime("%y-%m-%d-%H-%M-%S") + ".log"),
+ "w") as f:
for linen in sprc.stdout:
line = linen.decode(sys.getdefaultencoding())
f.write(line)