mirror of https://github.com/FOME-Tech/openblt.git
Refs #384. Updated python bindings package for LibOpenBLT, such that it can load the shared library file from the current working directory, if it is present there.
git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@439 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
parent
648c1ff798
commit
13193a3a51
|
@ -34,6 +34,7 @@ __docformat__ = 'reStructuredText'
|
||||||
# ***************************************************************************************
|
# ***************************************************************************************
|
||||||
import ctypes
|
import ctypes
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
# ***************************************************************************************
|
# ***************************************************************************************
|
||||||
|
@ -55,7 +56,12 @@ else:
|
||||||
sharedLibrary = 'libopenblt' + sharedLibraryExt
|
sharedLibrary = 'libopenblt' + sharedLibraryExt
|
||||||
|
|
||||||
|
|
||||||
# Get a handle to the shared library.
|
# Get a handle to the shared library. First assume that the shared library is in the
|
||||||
|
# current working directory. If not, then assume that it is located somewhere on the
|
||||||
|
# LD_LIBRARY_PATH.
|
||||||
|
if os.path.exists(os.path.join(os.getcwd(), sharedLibrary)):
|
||||||
|
sharedLibraryHandle = ctypes.CDLL(os.path.join(os.getcwd(), sharedLibrary))
|
||||||
|
else:
|
||||||
sharedLibraryHandle = ctypes.CDLL(sharedLibrary)
|
sharedLibraryHandle = ctypes.CDLL(sharedLibrary)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue