forked from cztomczak/cefpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevtools.py
More file actions
26 lines (20 loc) · 747 Bytes
/
devtools.py
File metadata and controls
26 lines (20 loc) · 747 Bytes
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
"""
This script is a workaround for CEF Python Issue #381 which is causing
keyboard issues in DevTools window in the wxpython.py example.
A solution is to open devtools window in a seprate process by executing
this script. An example usage is in the wxpython.py example. See
also the "api/DevToolsHandler.md" document.
"""
from cefpython3 import cefpython as cef
import sys
DEVTOOLS_URL = sys.argv[1]
def main():
print("[devtools.py] url={0}".format(DEVTOOLS_URL))
sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error
cef.Initialize()
cef.CreateBrowserSync(url=DEVTOOLS_URL,
window_title="DevTools")
cef.MessageLoop()
cef.Shutdown()
if __name__ == '__main__':
main()