]> Nishi Git Mirror - libw3.git/commitdiff
fixed python binding
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 9 Feb 2024 10:55:31 +0000 (10:55 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 9 Feb 2024 10:55:31 +0000 (10:55 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@196 d27a3e52-49c5-7645-884c-6793ebffc270

Python/__init__.py

index d8f621e9788bed5c193fda9b11ac884e937ac5d1..5e2cd08aa079630f1a59a875a7185bb906754d88 100644 (file)
@@ -4,11 +4,7 @@ import ctypes.util
 
 __all__ = ["w3", "libw3"]
 
-libpath = ctypes.util.find_library("w3")
-if not(libpath):
-       raise Exception("LibW3 not found")
-
-libw3_loaded = ctypes.CDLL(libpath)
+libw3_loaded = ctypes.CDLL("libw3.so")
 
 libw3_loaded.W3_Do_Debug.argtypes = [ctypes.c_bool]
 libw3_loaded.W3_Do_Debug = None
@@ -103,8 +99,12 @@ class w3:
        def send_request(self):
                libw3_loaded.W3_Send_Request(self._client)
        def destroy(self):
-               new_list = list(filter(lambda x: x._client != self._client, w3_list))
-               w3_list = list()
+               global w3_list
+               new_list = list()
+               for i in w3_list:
+                       if i._client != self._client:
+                               new_list.append(i)
+               w3_list = new_list
                libw3_loaded.W3_Free(self._client)
 
 class libw3: