import re import sys from pyczmq._cffi import ffi try: # If LD_LIBRARY_PATH or your OSs equivalent is set, this is the only way to # load the library. If we use find_library below, we get the wrong result. if os.name == 'posix': if sys.platform == 'darwin': libpath = 'libzebra.0.dylib' else: libpath = 'libzebra.so.0' elif os.name == 'nt': libpath = 'libzebra.dll' lib = ffi.dlopen(libpath) except OSError: libpath = find_library("zebra") if not libpath: raise ImportError("Unable to find libzebra") lib = ffi.dlopen(libpath) # Custom setup for zebra cdefs = ''' typedef struct _zeb_client_t zeb_client_t; typedef struct _zactor_t zactor_t; typedef struct _zsock_t zsock_t; typedef struct _zmsg_t zmsg_t; typedef struct _zuuid_t zuuid_t; typedef struct _zeb_handler_t zeb_handler_t;
import re import sys from pyczmq._cffi import ffi try: # If LD_LIBRARY_PATH or your OSs equivalent is set, this is the only way to # load the library. If we use find_library below, we get the wrong result. if os.name == 'posix': if sys.platform == 'darwin': libpath = 'libzyre.1.dylib' else: libpath = 'libzyre.so.1' elif os.name == 'nt': libpath = 'libzyre.dll' lib = ffi.dlopen(libpath) except OSError: libpath = find_library("zyre") if not libpath: raise ImportError("Unable to find libzyre") lib = ffi.dlopen(libpath) # Custom setup for zyre cdefs = ''' typedef struct _zyre_t zyre_t; typedef struct _zmsg_t zmsg_t; typedef struct _zlist_t zlist_t; typedef struct _zsock_t zsock_t; typedef struct _zyre_event_t zyre_event_t;