[PATCH evemu 09/16] python: fix evemu.Device.has_prop() for string arguments
Peter Hutterer
peter.hutterer at who-t.net
Mon Aug 11 18:34:43 PDT 2014
Using 'prop' instead of 'event_code' would be more sensible but it'd break
API, python allows named arguments.
Introduced in 385b6e3d8cd257e878cbe82e4bd0f38d8b8b1ca7
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
python/evemu/__init__.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/python/evemu/__init__.py b/python/evemu/__init__.py
index 8d7163f..0a639c3 100644
--- a/python/evemu/__init__.py
+++ b/python/evemu/__init__.py
@@ -341,9 +341,10 @@ class Device(object):
return self._libevemu.evemu_get_abs_resolution(self._evemu_device,
event_code)
+ # don't change 'event_code' to prop, it breaks API
def has_prop(self, event_code):
if type(event_code) == str:
- event_code = evemu.event_get_value("EV_ABS", event_code)
+ event_code = evemu.input_prop_get_value(event_code)
result = self._libevemu.evemu_has_prop(self._evemu_device, event_code)
return bool(result)
--
1.9.3
More information about the Input-tools
mailing list