From 345ffb1998fa591878ed1330c04b788168466fa3 Mon Sep 17 00:00:00 2001 From: Vilius Grigaliƫnas Date: Mon, 18 Sep 2017 20:21:58 +0300 Subject: Fixed TypeError: _handle_key_binding_message() signature incompatibility with mpv < v0.15.0 key-binding message has key name parameter only since mpv version 0.15.0 (as stated in manual), therefore trying to bind keys with earlier versions results in TypeError: _handle_key_binding_message() missing 1 required positional argument: 'key_name'. This change makes this argument optional and default to None. --- mpv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpv.py b/mpv.py index 3fd14ae..9805a30 100644 --- a/mpv.py +++ b/mpv.py @@ -993,7 +993,7 @@ class MPV(object): raise TypeError('register_key_binding expects either an str with an mpv command or a python callable.') self.command('enable-section', binding_name, 'allow-hide-cursor+allow-vo-dragging') - def _handle_key_binding_message(self, binding_name, key_state, key_name): + def _handle_key_binding_message(self, binding_name, key_state, key_name=None): self._key_binding_handlers[binding_name](key_state, key_name) def unregister_key_binding(self, keydef): -- cgit