Make video-pan-x and video-pan-y floats as they should be
This commit is contained in:
parent
73f2e87f66
commit
588d74938c
2 changed files with 3 additions and 5 deletions
|
@ -38,11 +38,9 @@ class TestProperties(unittest.TestCase):
|
||||||
for name, (ptype, access) in mpv.ALL_PROPERTIES.items():
|
for name, (ptype, access) in mpv.ALL_PROPERTIES.items():
|
||||||
if 'r' in access:
|
if 'r' in access:
|
||||||
name = name.replace('-', '_')
|
name = name.replace('-', '_')
|
||||||
try:
|
with self.subTest(property_name=name):
|
||||||
with self.swallow_mpv_errors():
|
with self.swallow_mpv_errors():
|
||||||
rv = getattr(self.m, name)
|
rv = getattr(self.m, name)
|
||||||
except Exception as e:
|
|
||||||
raise RuntimeError('Error while testing property', name)
|
|
||||||
if rv is not None: # Technically, any property can return None (even if of type e.g. int)
|
if rv is not None: # Technically, any property can return None (even if of type e.g. int)
|
||||||
self.assertEqual(type(rv), ptype, msg=name)
|
self.assertEqual(type(rv), ptype, msg=name)
|
||||||
|
|
||||||
|
|
4
mpv.py
4
mpv.py
|
@ -626,8 +626,8 @@ ALL_PROPERTIES = {
|
||||||
'video': (str, 'rw'), # alias for vid
|
'video': (str, 'rw'), # alias for vid
|
||||||
'video-align-x': (float, 'rw'),
|
'video-align-x': (float, 'rw'),
|
||||||
'video-align-y': (float, 'rw'),
|
'video-align-y': (float, 'rw'),
|
||||||
'video-pan-x': (int, 'rw'),
|
'video-pan-x': (float, 'rw'),
|
||||||
'video-pan-y': (int, 'rw'),
|
'video-pan-y': (float, 'rw'),
|
||||||
'video-zoom': (float, 'rw'),
|
'video-zoom': (float, 'rw'),
|
||||||
'video-unscaled': (ynbool, 'w'),
|
'video-unscaled': (ynbool, 'w'),
|
||||||
'program': (int, 'w'),
|
'program': (int, 'w'),
|
||||||
|
|
Loading…
Reference in a new issue