diff options
author | jaseg <git@jaseg.de> | 2024-07-15 14:52:59 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2024-07-15 14:52:59 +0200 |
commit | f4086d4bb44603dcbaac51a162b280f760cbde2c (patch) | |
tree | 4c812333fe5cca2f768705639ad531a919713518 /mpv.py | |
parent | e1ae4f7da6d1858ab5af7d003c24fd6ca1f8fed5 (diff) | |
download | python-mpv-f4086d4bb44603dcbaac51a162b280f760cbde2c.tar.gz python-mpv-f4086d4bb44603dcbaac51a162b280f760cbde2c.tar.bz2 python-mpv-f4086d4bb44603dcbaac51a162b280f760cbde2c.zip |
Add API to set dict-valued properties
Diffstat (limited to 'mpv.py')
-rw-r--r-- | mpv.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2064,7 +2064,10 @@ class MPV(object): def _set_property(self, name, value): self.check_core_alive() ename = name.encode('utf-8') - if isinstance(value, (list, set, dict)): + if isinstance(value, dict): + _1, _2, _3, pointer = _make_node_str_map(value) + _mpv_set_property(self.handle, ename, MpvFormat.NODE, pointer) + elif isinstance(value, (list, set)): _1, _2, _3, pointer = _make_node_str_list(value) _mpv_set_property(self.handle, ename, MpvFormat.NODE, pointer) else: |