FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cefpython/src/cefpython3/__init__.py at master · vsajip/cefpython · GitHub
vsajip
cefpython
Repository navigation
Code
Pull requests
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cefpython
/
src
/
cefpython3
/
__init__.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (25 loc) · 1.07 KB
Breadcrumbs
cefpython
/
src
/
cefpython3
/
__init__.py
Copy path
File metadata and controls
31 lines (25 loc) · 1.07 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
import
ctypes
import
importlib
import
os
import
platform
import
sys
__all__
=
[
"cefpython"
]
__author__
=
"The CEF Python authors"
from
.
_version
import
__version__
package_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
# Let subprocess and the C extension find CEF DLLs / .so files next to this
# __init__.py regardless of the working directory.
os
.
environ
[
"CEFPYTHON3_PATH"
]
=
package_dir
if
platform
.
system
()
==
"Linux"
:
# Force GDK to use X11/XWayland backend before libcef.so loads and
# initialises GDK. Without this, GDK picks the Wayland backend on
# GNOME/Wayland sessions, making gdk_x11_window_get_xid() return 0.
os
.
environ
.
setdefault
(
"GDK_BACKEND"
,
"x11"
)
_ld
=
os
.
environ
.
get
(
"LD_LIBRARY_PATH"
,
""
)
os
.
environ
[
"LD_LIBRARY_PATH"
]
=
(
package_dir
+
os
.
pathsep
+
_ld
if
_ld
else
package_dir
)
ctypes
.
CDLL
(
os
.
path
.
join
(
package_dir
,
"libcef.so"
),
ctypes
.
RTLD_GLOBAL
)
_pyver
=
"{0}{1}"
.
format
(
*
sys
.
version_info
[:
2
])
cefpython
=
importlib
.
import_module
(
".cefpython_py{}"
.
format
(
_pyver
),
package
=
__name__
)
cefpython
.
__version__
=
__version__
Back
|
FazBrowse Home
|
New Git URL