forked from cztomczak/cefpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py.template
More file actions
38 lines (30 loc) · 1.36 KB
/
__init__.py.template
File metadata and controls
38 lines (30 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
__all__ = ["cefpython", "wx"]
__version__ = "%(APP_VERSION)s"
__author__ = "The CEF Python authors"
import ctypes, os
# If this is a debian package then package_dir returns:
# /usr/lib/pymodules/python2.7/cefpython3
# The above path consists of symbolic links to the real directory:
# /usr/share/pyshared/cefpython3
# If package was installed using PIP or setup.py then package
# dir is here:
# /usr/local/lib/python2.7/dist-packages/cefpython3/
package_dir = os.path.dirname(os.path.abspath(__file__))
# This loads the libcef.so library for the subprocess executable.
os.environ["LD_LIBRARY_PATH"] = package_dir
# This env variable will be returned by cefpython.GetModuleDirectory().
os.environ["CEFPYTHON3_PATH"] = package_dir
# This loads the libcef.so library for the main python executable.
# The libffmpegsumo.so library does not need to be loaded here,
# it may cause issues to load it here in the browser process.
libcef_so = os.path.join(package_dir, "libcef.so")
ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL)
import sys
if 0x02070000 <= sys.hexversion < 0x02080000:
from . import cefpython_py27 as cefpython
elif 0x03040000 <= sys.hexversion < 0x03050000:
from . import cefpython_py34 as cefpython
elif 0x03050000 <= sys.hexversion < 0x03060000:
from . import cefpython_py35 as cefpython
else:
raise Exception("Unsupported python version: " + sys.version)