diff --git a/voctocore/lib/sources/decklinkavsource.py b/voctocore/lib/sources/decklinkavsource.py index 7a1303bc..bfd326a8 100644 --- a/voctocore/lib/sources/decklinkavsource.py +++ b/voctocore/lib/sources/decklinkavsource.py @@ -8,6 +8,7 @@ class DeckLinkAVSource(AVSource): + def __init__(self, name, outputs=None, has_audio=True, has_video=True): self.log = logging.getLogger('DecklinkAVSource[{}]'.format(name)) super().__init__(name, outputs, has_audio, has_video) @@ -94,7 +95,7 @@ def _parse_audiostream_map(self, config_section): for key in Config[config_section]: value = Config.get(config_section, key) - m = re.match('audiostream\[(\d+)\]', key) + m = re.match(r'audiostream\[(\d+)\]', key) if m: audiostream = int(m.group(1)) audiostream_map[audiostream] = value @@ -102,7 +103,7 @@ def _parse_audiostream_map(self, config_section): return audiostream_map def _parse_audiostream_mapping(self, mapping): - m = re.match('(\d+)\+(\d+)', mapping) + m = re.match(r'(\d+)\+(\d+)', mapping) if m: return (int(m.group(1)), int(m.group(2)),) else: diff --git a/voctocore/tests/helper/voctomix_test.py b/voctocore/tests/helper/voctomix_test.py index e19a865e..29d97aa8 100644 --- a/voctocore/tests/helper/voctomix_test.py +++ b/voctocore/tests/helper/voctomix_test.py @@ -22,7 +22,7 @@ def setUp(self): lib.config.Config.resetToDefaults() def assertContainsIgnoringWhitespace(self, text, search): - regex = search.replace(" ", "\s*") + regex = search.replace(" ", r"\s*") try: self.assertRegex(text, regex) diff --git a/voctocore/voctocore.py b/voctocore/voctocore.py index f80905a6..fe59bb2b 100755 --- a/voctocore/voctocore.py +++ b/voctocore/voctocore.py @@ -70,8 +70,8 @@ def main(): args.parse() from lib.args import Args - docolor = (Args.color == 'always') or (Args.color == 'auto' and - sys.stderr.isatty()) + docolor = (Args.color == 'always') \ + or (Args.color == 'auto' and sys.stderr.isatty()) handler = LogHandler(docolor, Args.timestamp) logging.root.addHandler(handler) diff --git a/voctogui/lib/connection.py b/voctogui/lib/connection.py index 86830787..caddbe2c 100644 --- a/voctogui/lib/connection.py +++ b/voctogui/lib/connection.py @@ -17,7 +17,7 @@ def establish(host): log.info('establishing Connection to %s', host) conn = socket.create_connection((host, port)) - log.debug('Connection successful \o/') + log.debug(r'Connection successful \o/') ip = conn.getpeername()[0] log.debug('Remote-IP is %s', ip) diff --git a/voctogui/lib/videodisplay.py b/voctogui/lib/videodisplay.py index 0714f80c..36eba206 100644 --- a/voctogui/lib/videodisplay.py +++ b/voctogui/lib/videodisplay.py @@ -21,8 +21,8 @@ def __init__(self, drawing_area, port, width=None, height=None, else: previewcaps = Config.get('mix', 'videocaps') - use_previews = (Config.getboolean('previews', 'enabled') and - Config.getboolean('previews', 'use')) + use_previews = Config.getboolean('previews', 'enabled') \ + and Config.getboolean('previews', 'use') # Preview-Ports are Raw-Ports + 1000 if use_previews: diff --git a/voctogui/voctogui.py b/voctogui/voctogui.py index f20889a8..4f23fbb0 100755 --- a/voctogui/voctogui.py +++ b/voctogui/voctogui.py @@ -34,6 +34,7 @@ # main class class Voctogui(object): + def __init__(self): self.log = logging.getLogger('Voctogui') from lib.args import Args @@ -123,8 +124,8 @@ def main(): args.parse() from lib.args import Args - docolor = (Args.color == 'always') or (Args.color == 'auto' and - sys.stderr.isatty()) + docolor = (Args.color == 'always') \ + or (Args.color == 'auto' and sys.stderr.isatty()) from lib.loghandler import LogHandler handler = LogHandler(docolor, Args.timestamp) @@ -165,8 +166,8 @@ def main(): # The list-comparison is not complete # (one could use a local hostname or the local system ip), # but it's only here to warn that one might be making a mistake - use_previews = (Config.getboolean('previews', 'enabled') and - Config.getboolean('previews', 'use')) + use_previews = Config.getboolean('previews', 'enabled') \ + and Config.getboolean('previews', 'use') looks_like_localhost = Config.get('server', 'host') in ['::1', '127.0.0.1', 'localhost']