diff options
author | emkael <emkael@tlen.pl> | 2019-07-18 01:56:03 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-07-18 01:56:03 +0200 |
commit | fae6d4c7aeda91da216f408ccab1b15dec899fa5 (patch) | |
tree | c8b0a8856164236e4351456c6a7315dc5b033b88 /bcdd/BCalcWrapper.py | |
parent | c0837425a7ba145b865cfe5bc67ab3b541ce05f8 (diff) |
DLL load path relative to wrapper location
Diffstat (limited to 'bcdd/BCalcWrapper.py')
-rw-r--r-- | bcdd/BCalcWrapper.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bcdd/BCalcWrapper.py b/bcdd/BCalcWrapper.py index d7ed7cd..33b79d2 100644 --- a/bcdd/BCalcWrapper.py +++ b/bcdd/BCalcWrapper.py @@ -2,6 +2,7 @@ Wrapper class for libbcalcDDS.dll ''' +import os from ctypes import cdll, c_void_p from .Exceptions import DllNotFoundException @@ -13,11 +14,16 @@ class BCalcWrapper(object): PLAYERS = [ 'N', 'E', 'S', 'W' ] def __init__(self): + dllPath = os.path.join( + os.path.dirname(__file__), + '..') try: - self.libbcalcdds = cdll.LoadLibrary('./libbcalcdds.dll') + self.libbcalcdds = cdll.LoadLibrary(os.path.join( + dllPath, 'libbcalcdds.dll')) except OSError: try: - self.libbcalcdds = cdll.LoadLibrary('./libbcalcdds.so') + self.libbcalcdds = cdll.LoadLibrary(os.path.join( + dllPath, 'libbcalcdds.so')) except OSError: self.libbcalcdds = None if self.libbcalcdds is None: |