From aacda095cbca1e0e6094c02c7c4cce3379fd47e2 Mon Sep 17 00:00:00 2001 From: Elias Nygren Date: Thu, 29 Sep 2016 15:55:53 +0300 Subject: [PATCH] skip empty lines --- supervisor_stdout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor_stdout.py b/supervisor_stdout.py index b1ae219..440afec 100644 --- a/supervisor_stdout.py +++ b/supervisor_stdout.py @@ -19,7 +19,7 @@ def main(): def event_handler(event, response): line, data = response.split('\n', 1) headers = dict([ x.split(':') for x in line.split() ]) - lines = data.split('\n') + lines = [ l for l in data.split('\n') if l not in ['', '\n'] ] prefix = '%s %s | '%(headers['processname'], headers['channel']) print '\n'.join([ prefix + l for l in lines ])