Commit graph

261 commits

Author SHA1 Message Date
Frechdachs
ec91bf3e57 Fix unobserve_property
There were three problems:

1. MPV.unobserve_property called _mpv_observe_property instead of _mpv_unobserve_property.
2. _mpv_unobserve_property returns the number of properties that were assigned to the handler that is being removed. Because the return value is not 0 in such a case, ErrorCode.raise_for_ec tries to raise an error. To fix that, I changed the ErrorCode.raise_for_ec functon not to raise an error if ec is larger than 0. (If there is a positive return value, there should not have been an error anyway, if I'm not mistaken.)
3. Calling MPV.unobserve_property for a handle that is not currently been used, should not result in a KeyError being raised.

An alternative to 2. would be to add a restype to the _handle_func of 'mpv_unobserve_property' and returning that value in MPV.unobserve_property. (That way, raise_for_ec is never called.)  But I don't think this value is useful in any way. Even the built in lua interface does not return that value.
2016-02-09 22:53:52 +01:00
jaseg
694a2c2c62 Add observe_property support 2016-02-08 23:50:45 +01:00
jaseg
a1c170d6ff Remove asyncio for windows support 2016-01-04 13:20:42 +01:00
jaseg
fb1704c4dc Fixed accidental python2-ism in ynbool. Fixes #1
Thanks to u8sand from github for this.
2015-11-01 18:22:54 +01:00
jaseg
28b761627f Small beautifications 2015-05-10 17:55:06 +02:00
jaseg
df80c10799 Added vim swap files to the .gitignore 2014-08-14 00:34:12 +02:00
jaseg
b19b37708b Fixed encoding handling to use the system's default encoding 2014-08-14 00:15:17 +02:00
jaseg
f74f0a3191 Removed a bunch of asserts and added some doc
Now leaving command parameter value checking to libmpv.
2014-08-14 00:01:21 +02:00
jaseg
baee4f4e22 Added support for yet-unknown error codes 2014-08-13 23:51:07 +02:00
jaseg
2e6516aa32 Added optional loading of liblua 2014-08-13 23:28:28 +02:00
jaseg
9b68b0866e Initial commit 2014-08-10 23:27:26 +02:00