configuration

This commit is contained in:
Vitor Santos Costa
2017-11-09 12:14:41 +00:00
parent 3bb4570c55
commit 5c199984ed
7 changed files with 48 additions and 41 deletions

View File

@@ -9,16 +9,17 @@ import sys
# global yap_lib_path
#yap_lib_path = os.path.dirname(__file__)
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)
load('libYap*')
# else:
# def load( dll ):
# dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
# dll = os.path.abspath(dll)
# ctypes.CDLL(dll, mode=ctypes.RTLD_GLOBAL)
# load('libYap*')
# load('libPy4YAP*')
# 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)
# else:
# def load( l0 ):
# for i in ["@libdir@",""]:
# dll = os.path.concat(i,l0)
# dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
# dll = os.path.abspath(dll)
# ctypes.CDLL(dll)
# # load('libYap*')
# # load('libPy4YAP*')

View File

@@ -10,6 +10,7 @@ from .yap import *
class Engine( YAPEngine ):
def __init__(self, args=None,**kwargs):
# type: (object) -> object
self.contained = False
@@ -17,14 +18,13 @@ class Engine( YAPEngine ):
args = EngineArgs(**kwargs)
if self.contained:
yap_lib_path = os.path.dirname(__file__)
args.setYapShareDir(os.path.join(yap_lib_path,"prolog"))
args.setYapShareDir(os.path.join(yap_lib_path, "prolog"))
args.setYapLibDir(yap_lib_path)
args.setSavedState(os.path.join(yap_lib_path,"startup.yss"))
YAPEngine.__init__(self,args)
self.goal( set_prolog_flag('verbose', 'silent' ) )
self.goal( use_module(library('yapi') ) )
self.goal( set_prolog_flag('verbose', 'normal' ) )
args.setSavedState(os.path.join(yap_lib_path, "startup.yss"))
YAPEngine.__init__(self, args)
self.goal(set_prolog_flag('verbose', 'silent'))
self.goal(use_module(library('yapi')))
self.goal(set_prolog_flag('verbose', 'normal'))
def run(self, g, m=None):
if m: