[PATCH evemu 12/16] python: move the library name to the class that loads it

Peter Hutterer peter.hutterer at who-t.net
Mon Aug 11 18:34:46 PDT 2014


With the goal of deprecating the evemu.const file.

This is the only class that cares about the name of the lib, so define it
here. Something fancier involving Makefiles and generation from base.py.in is
possible, but probably more trouble than it's worth.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 python/evemu/base.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/evemu/base.py b/python/evemu/base.py
index 5cca150..8d8b3de 100644
--- a/python/evemu/base.py
+++ b/python/evemu/base.py
@@ -8,7 +8,6 @@ import os
 # Import types directly, so they don't have to be prefixed with "ctypes.".
 from ctypes import c_char_p, c_int, c_uint, c_void_p, c_long, c_int32, c_uint16
 
-import evemu.const
 import evemu.exception
 
 
@@ -165,9 +164,11 @@ class LibEvemu(LibraryWrapper):
     Wrapper for API calls to the evemu library.
     """
 
+    _LIBNAME = "libevemu.so"
+
     @staticmethod
     def _cdll():
-        return ctypes.CDLL(evemu.const.LIB, use_errno=True)
+        return ctypes.CDLL(LibEvemu._LIBNAME, use_errno=True)
 
     _api_prototypes = {
         #struct evemu_device *evemu_new(const char *name);
-- 
1.9.3



More information about the Input-tools mailing list