def __init__(self):
""" Init a JS context """
self.ext = ctypes.CDLL(EXTENSION_PATH)
self.ext.mr_init_context.restype = ctypes.c_void_p
self.ext.mr_eval_context.argtypes = [
ctypes.c_void_p,
ctypes.c_char_p,
ctypes.c_int]
self.ext.mr_eval_context.restype = ctypes.POINTER(PythonValue)
self.ext.mr_free_value.argtypes = [ctypes.c_void_p]
self.ext.mr_free_context.argtypes = [ctypes.c_void_p]
self.ctx = self.ext.mr_init_context()
self.lock = threading.Lock()
评论列表
文章目录