From 9ecc171645c9f2fd217d98e6ff613d0d0ae051c5 Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Fri, 8 Nov 2019 10:27:23 +0100 Subject: [PATCH] remove double import, format console output --- ffplayout.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ffplayout.py b/ffplayout.py index 5b598571..f624a8dc 100755 --- a/ffplayout.py +++ b/ffplayout.py @@ -42,7 +42,6 @@ from subprocess import PIPE, CalledProcessError, Popen, check_output from threading import Thread from types import SimpleNamespace from urllib import request -from threading import Thread try: if os.name != 'posix': @@ -274,6 +273,8 @@ class CustomFormatter(logging.Formatter): def format_message(self, msg): if '"' in msg and '[' in msg: msg = re.sub('(".*?")', self.cyan + r'\1' + self.reset, msg) + elif '[decoder]' in msg: + msg = re.sub(r'(\[decoder\])', self.red + r'\1' + self.reset, msg) elif '/' in msg or '\\' in msg: msg = re.sub( r'(["\w.:/]+/|["\w.:]+\\.*?)', self.magenta + r'\1', msg) @@ -511,7 +512,7 @@ def terminate_processes(watcher=None): def decoder_error_reader(pipe): try: for line in pipe.stderr: - messenger.error('ffmpeg decoder: {}'.format(line.decode("utf-8"))) + messenger.error('[decoder] {}'.format(line.decode("utf-8"))) except ValueError: pass