[PATCH evemu 4/7] python: replace input_prop_get_name with the C implementation

Benjamin Tissoires benjamin.tissoires at gmail.com
Thu Aug 14 11:00:42 PDT 2014


No functional change, but relying on an external lib removes the
pain to maintain our own input.h implementation.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>
---
 python/evemu/__init__.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/python/evemu/__init__.py b/python/evemu/__init__.py
index c50131c..882d91d 100644
--- a/python/evemu/__init__.py
+++ b/python/evemu/__init__.py
@@ -103,10 +103,9 @@ def input_prop_get_name(prop):
     """
     Return the name of the input property, or None if undefined.
     """
-    try:
-        return evemu.event_names._input_prop_get_name(prop)
-    except KeyError:
-        return None
+    if type(prop) != int:
+        raise TypeError("expected an int")
+    return _libevemu.evemu_property_get_name(prop)
 
 def input_prop_get_value(prop):
     """
-- 
2.0.4



More information about the Input-tools mailing list