From e52a9545f7e14e0eda5e78d6bb255f019cab4f87 Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 13 Jul 2017 00:37:25 +0200 Subject: Fix message handler registration and advanced README example --- README.rst | 2 +- mpv.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 5e52aca..a06509a 100644 --- a/README.rst +++ b/README.rst @@ -78,7 +78,7 @@ Advanced Usage def time_observer(_name, value): # Here, _value is either None if nothing is playing or a float containing # fractional seconds since the beginning of the file. - print('Now playing at {:.2f}s'.format(value))) + print('Now playing at {:.2f}s'.format(value)) player.fullscreen = True player.loop = 'inf' diff --git a/mpv.py b/mpv.py index 7a7c1a2..d76f9a3 100644 --- a/mpv.py +++ b/mpv.py @@ -766,8 +766,7 @@ class MPV(object): ``` """ self._register_message_handler_internal(target, handler) - def _register_script_message_handler_internal(self, target, handler): - handler.mpv_message_targets = getattr(handler, 'mpv_script_message_targets', []) + [target] + def _register_message_handler_internal(self, target, handler): self._message_handlers[target] = handler def unregister_message_handler(self, target_or_handler): -- cgit