FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cefpython/tools/installer/cefpython3.__init__.py at cefpython55 · huamoran/cefpython · GitHub
huamoran
cefpython
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
cefpython
/
tools
/
installer
/
cefpython3.__init__.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
77 lines (66 loc) · 2.84 KB
Breadcrumbs
cefpython
/
tools
/
installer
/
cefpython3.__init__.py
Copy path
File metadata and controls
77 lines (66 loc) · 2.84 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright (c) 2017 The CEF Python authors. All rights reserved.
# Licensed under BSD 3-clause license.
# NOTE: Template variables like {{VERSION}} are replaced with actual
# values when make_installer.py tool generates this package
# installer.
import
os
import
sys
import
ctypes
import
platform
__all__
=
[
"cefpython"
]
# Disabled: "wx"
__version__
=
"{{VERSION}}"
__author__
=
"The CEF Python authors"
# If package was installed using PIP or setup.py then package
# dir is here:
# /usr/local/lib/python2.7/dist-packages/cefpython3/
# 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
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
# On Mac it works without setting library paths. Better not set it,
# as maybe user's app will set it itself.
# > os.environ["DYLD_LIBRARY_PATH"] = package_dir
# > os.environ["DYLD_FRAMEWORK_PATH"] = package_dir
# This env variable will be returned by cefpython.GetModuleDirectory().
os
.
environ
[
"CEFPYTHON3_PATH"
]
=
package_dir
# This loads the libcef library for the main python executable.
# This is required only on linux and Mac.
# The libffmpegsumo.so library does not need to be loaded here,
# it may cause issues to load it here in the browser process.
libcef
=
None
if
platform
.
system
()
==
"Darwin"
:
cef_framework
=
"Chromium Embedded Framework.framework"
libcef_name
=
"Chromium Embedded Framework"
# Search for it in current directory or in ../Frameworks/ dir
# in case this is user's app packaged for distribution.
libcef1
=
os
.
path
.
join
(
package_dir
,
cef_framework
,
libcef_name
)
libcef2
=
os
.
path
.
join
(
package_dir
,
".."
,
"Frameworks"
,
cef_framework
,
libcef_name
)
if
os
.
path
.
exists
(
libcef1
):
libcef
=
libcef1
elif
os
.
path
.
exists
(
libcef2
):
libcef
=
libcef2
else
:
raise
Exception
(
"Can't find: "
+
cef_framework
)
elif
platform
.
system
()
==
"Linux"
:
libcef
=
os
.
path
.
join
(
package_dir
,
"libcef.so"
)
if
libcef
:
ctypes
.
CDLL
(
libcef
,
ctypes
.
RTLD_GLOBAL
)
# Load the cefpython module for proper Python version
if
sys
.
version_info
[:
2
]
==
(
2
,
8
):
# noinspection PyUnresolvedReferences
from
.
import
cefpython_py27
as
cefpython
elif
sys
.
version_info
[:
2
]
==
(
3
,
4
):
# noinspection PyUnresolvedReferences
from
.
import
cefpython_py34
as
cefpython
elif
sys
.
version_info
[:
2
]
==
(
3
,
5
):
# noinspection PyUnresolvedReferences
from
.
import
cefpython_py35
as
cefpython
elif
sys
.
version_info
[:
2
]
==
(
3
,
6
):
# noinspection PyUnresolvedReferences
from
.
import
cefpython_py36
as
cefpython
else
:
raise
Exception
(
"Python version not supported: "
+
sys
.
version
)
Back
|
FazBrowse Home
|
New Git URL