LIRC libraries: /tmp/work/src/lirc-0.10.2/python-pkg/lirc/paths.py Source File

LIRC libraries Linux Infrared Remote Control

Loading...
Searching...
No Matches
paths.py
1''' Set up paths to components, including in-tree development. '''
2
3import glob
4import sys
5import os.path
6
7
8HERE = os.path.abspath(os.path.dirname(__file__))
9if HERE not in sys.path:
10 sys.path.insert(0, HERE)
11
12if os.path.exists(os.path.join(HERE, '_client.so')):
13 try:
14 os.unlink(os.path.join(HERE, '_client.so'))
15 except PermissionError:
16 pass
17if os.path.exists(os.path.join(HERE, '..', 'lib', '.libs', '_client.so')):
18 if not os.path.exists(os.path.join(HERE, '_client.so')):
19 # development tree Makefile.am creates lib/libs/_client.so
20 # after 'make install'; plain 'make' isn't enough.
21 os.symlink(os.path.join('..', 'lib', '.libs', '_client.so'),
22 os.path.join(HERE, '_client.so'))
23else:
24 # 'python setup.py' artifact:
25 SRC = glob.glob(os.path.join(
26 HERE, '..build/lib.linux*/_client.cpython*.so'))
27 if len(SRC) == 1:
28 os.symlink(os.path.join(SRC[0]), os.path.join(HERE, '_client.so'))