[vlc-commits] python bindings: use ctypes.util.find_library on linux also
Olivier Aubert
git at videolan.org
Thu May 12 12:24:53 CEST 2011
vlc/python | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Thu May 12 12:23:46 2011 +0200| [00c5269c2896fece9a6108c122ada53c0f641cbf] | committer: Olivier Aubert
python bindings: use ctypes.util.find_library on linux also
Based on a suggestion by Jason Scheunemann
> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=00c5269c2896fece9a6108c122ada53c0f641cbf
---
generated/vlc.py | 8 ++++----
header.py | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/generated/vlc.py b/generated/vlc.py
index 355c02d..6a46c37 100755
--- a/generated/vlc.py
+++ b/generated/vlc.py
@@ -47,20 +47,20 @@ import sys
from inspect import getargspec
__version__ = "N/A"
-build_date = "Fri Apr 29 10:39:54 2011"
+build_date = "Thu May 12 09:38:58 2011"
# Used on win32 and MacOS in override.py
plugin_path = None
if sys.platform.startswith('linux'):
+ p = find_library('vlc')
try:
- dll = ctypes.CDLL('libvlc.so')
+ dll = ctypes.CDLL(p)
except OSError: # may fail
dll = ctypes.CDLL('libvlc.so.5')
elif sys.platform.startswith('win'):
- import ctypes.util as u
- p = u.find_library('libvlc.dll')
+ p = find_library('libvlc.dll')
if p is None:
try: # some registry settings
import _winreg as w # leaner than win32api, win32con
diff --git a/header.py b/header.py
index cc1ac8d..4ea0888 100755
--- a/header.py
+++ b/header.py
@@ -52,14 +52,14 @@ build_date = '' # build time stamp and __version__, see generate.py
plugin_path = None
if sys.platform.startswith('linux'):
+ p = find_library('vlc')
try:
- dll = ctypes.CDLL('libvlc.so')
+ dll = ctypes.CDLL(p)
except OSError: # may fail
dll = ctypes.CDLL('libvlc.so.5')
elif sys.platform.startswith('win'):
- import ctypes.util as u
- p = u.find_library('libvlc.dll')
+ p = find_library('libvlc.dll')
if p is None:
try: # some registry settings
import _winreg as w # leaner than win32api, win32con
More information about the vlc-commits
mailing list