diff options
author | Vilius Grigaliƫnas <vilius.grigaliunas@gmail.com> | 2017-09-18 20:21:58 +0300 |
---|---|---|
committer | Vilius Grigaliƫnas <vilius.grigaliunas@gmail.com> | 2017-09-18 20:21:58 +0300 |
commit | 345ffb1998fa591878ed1330c04b788168466fa3 (patch) | |
tree | d97db88c91b15d89197d372c3fca48e7db7c61a0 | |
parent | 4ebf4e1c373896951e34a1b3dd3f5e100fe5a758 (diff) | |
download | python-mpv-345ffb1998fa591878ed1330c04b788168466fa3.tar.gz python-mpv-345ffb1998fa591878ed1330c04b788168466fa3.tar.bz2 python-mpv-345ffb1998fa591878ed1330c04b788168466fa3.zip |
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.
-rw-r--r-- | mpv.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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): |