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/__init__.py

31 lines
730 B
Python
Raw Normal View History

2017-05-02 07:38:23 +01:00
import imp
import os
import ctypes
import glob
import os.path
import sys
2017-06-13 13:34:17 +01:00
import platform
2017-05-02 07:38:23 +01:00
global yap_lib_path
yap_lib_path = os.path.dirname(__file__)
2017-12-11 03:36:21 +00:00
if @CONDA_BUILD@ == "1":
# do not do nothing
2017-06-13 13:34:17 +01:00
if platform.system() == 'Windows':
def load( dll ):
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
dll = os.path.abspath(dll)
ctypes.WinDLL(dll)
2017-06-15 22:40:55 +01:00
load('libYap*')
2017-06-13 13:34:17 +01:00
else:
def load( dll ):
2017-10-11 02:24:15 +01:00
dll = os.path.join(yap_lib_path,dll)
2017-06-13 13:34:17 +01:00
dll = os.path.abspath(dll)
ctypes.CDLL(dll, mode=ctypes.RTLD_GLOBAL)
2017-10-11 02:24:15 +01:00
if platform.system() == 'Apple':
load('libYap.dylib')
load('libPy4YAP.dylib' )
2017-12-11 03:36:21 +00:00
else:
load('libYap.os')
load('libPy4YAP.os' )