This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/python/swig/yap4py/__init__.py.in

34 lines
827 B
Python
Raw Normal View History

2017-12-11 04:01:11 +00:00
import imp
import os
import ctypes
import glob
import os.path
import platform
import sys
global yap_lib_path
yap_lib_path = "@CMAKE_INSTALL_FULL_LIBDIR@"
if platform.system() == 'Windows':
def load( dll ):
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
dll = os.path.abspath(dll)
2018-01-18 14:47:27 +00:00
ctypes.WinDLL(dll)
2018-01-05 16:57:38 +00:00
elif platform.system() == 'Darwin':
2017-12-11 04:01:11 +00:00
def load( dll ):
2018-03-12 15:11:59 +00:00
dll = glob.glob(os.path.join(os.path.dirname(__file__),dll))[0]
2018-01-05 16:57:38 +00:00
dll = os.path.abspath(dll)
ctypes.CDLL(dll)
2018-03-12 15:11:59 +00:00
print('loaded ',dll)
# try:
# load( '_yap*.so' )
# except:
# load( '_yap*.dylib' )
2018-01-18 14:47:27 +00:00
else:
def load( dll ):
2018-03-12 15:11:59 +00:00
dll = glob.glob(os.path.join(os.path.dirname(__file__),dll))[0]
2018-01-18 14:47:27 +00:00
dll = os.path.abspath(dll)
ctypes.CDLL(dll)
2018-03-18 00:44:08 +00:00
#load('_yap*.so')