From a1aff4508bf0e87ecc4736a3a196a43faca3ffa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 24 Jul 2015 17:25:31 +0200 Subject: Change log files position Log files won't be in only one folder. Every program have its own folder. --- scripts/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts/utils.py') diff --git a/scripts/utils.py b/scripts/utils.py index e3038e4..522a68d 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -58,8 +58,14 @@ def callsubprocess(process_name, process, show_output = True, return_output = False, env=os.environ, allowed_exit_codes = [0]): sprc = subprocess.Popen(process, stdout = subprocess.PIPE, env = env) + try: + os.mkdir(os.path.join(sf(conf.log_folder), process_name)) + except OSError: + pass + + rtn = [] with open(os.path.join(sf(conf.log_folder), - process_name + '-' + time.strftime("%y-%m-%d-%H-%M-%S") + ".log"), + process_name, time.strftime("%y-%m-%d-%H-%M-%S") + ".log"), "a") as f: f.write('::' + time.strftime("%y-%m-%d-%H-%M-%S-%f") + '::\n') for linen in sprc.stdout: -- cgit v1.2.3