Skip to content

Commit 23a6c62

Browse files
committed
Mac v56 release almost ready (cztomczak#295)...
Fixes to examples and build tools on Mac. Update to CEF 3.2924.1575.g97389a9 on Mac. Support automate.py --prebuilt-cef on Mac. Fix qt4.py example on Mac. Rename qt.py to qt4.py. Fix gtk2.py example on Mac. On Mac the gtk2.py example forces CEF message loop by default. You can enable debug information in all examples by passing --debug flag. Added info to KB. Add instructions on how to debug "segmentation fault" crash on Linux and Mac in the Knowledge Base document. Update all examples to add detailed notes about clearing all browser references for CEF to shutdown cleanly. Rename build_module.py tool to cython_setup.py. Enhance sudo detection in build.py. Increase time for message loop to 1 sec, otherwise tests sometimes fail with error: > AssertionError: Check assert: > LoadHandler.FrameSourceVisitor_True Create API.md document which links to root api/ directory. Enhance linking in api/ reference, in top headers and in API index.
1 parent 039a461 commit 23a6c62

File tree

18 files changed

+514
-327
lines changed

18 files changed

+514
-327
lines changed

api/API-index.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
[API categories](API-categories.md) | [API index](API-index.md)
1+
[API categories](API-categories.md#api-categories) | [API index](API-index.md#api-index)
22

33
# API index
44

5-
* [Application settings](ApplicationSettings.md)
5+
* [Application settings](ApplicationSettings.md#application-settings)
66
* [accept_language_list](ApplicationSettings.md#accept_language_list)
77
* [auto_zooming](ApplicationSettings.md#auto_zooming)
88
* [background_color](ApplicationSettings.md#background_color)
@@ -35,7 +35,7 @@
3535
* [user_agent](ApplicationSettings.md#user_agent)
3636
* [user_data_path](ApplicationSettings.md#user_data_path)
3737
* [windowless_rendering_enabled](ApplicationSettings.md#windowless_rendering_enabled)
38-
* [Browser (object)](Browser.md)
38+
* [Browser (object)](Browser.md#browser-object)
3939
* [AddWordToDictionary](Browser.md#addwordtodictionary)
4040
* [CanGoBack](Browser.md#cangoback)
4141
* [CanGoForward](Browser.md#cangoforward)
@@ -109,7 +109,7 @@
109109
* [TryCloseBrowser](Browser.md#tryclosebrowser)
110110
* [WasResized](Browser.md#wasresized)
111111
* [WasHidden](Browser.md#washidden)
112-
* [Browser settings](BrowserSettings.md)
112+
* [Browser settings](BrowserSettings.md#browser-settings)
113113
* [Font settings](BrowserSettings.md#font-settings)
114114
* [accept_language_list](BrowserSettings.md#accept_language_list)
115115
* [application_cache_disabled](BrowserSettings.md#application_cache_disabled)
@@ -134,10 +134,10 @@
134134
* [web_security_disabled](BrowserSettings.md#web_security_disabled)
135135
* [webgl_disabled](BrowserSettings.md#webgl_disabled)
136136
* [windowless_frame_rate](BrowserSettings.md#windowless_frame_rate)
137-
* [Callback (object)](Callback.md)
137+
* [Callback (object)](Callback.md#callback-object)
138138
* [Continue](Callback.md#continue)
139139
* [Cancel](Callback.md#cancel)
140-
* [cefpython](cefpython.md)
140+
* [cefpython](cefpython.md#cefpython)
141141
* [CreateBrowser](cefpython.md#createbrowser)
142142
* [CreateBrowserSync](cefpython.md#createbrowsersync)
143143
* [ExceptHook](cefpython.md#excepthook)
@@ -156,12 +156,12 @@
156156
* [SetGlobalClientCallback](cefpython.md#setglobalclientcallback)
157157
* [SetOsModalLoop](cefpython.md#setosmodalloop)
158158
* [Shutdown](cefpython.md#shutdown)
159-
* [Command line switches](CommandLineSwitches.md)
159+
* [Command line switches](CommandLineSwitches.md#command-line-switches)
160160
* [enable-media-stream](CommandLineSwitches.md#enable-media-stream)
161161
* [proxy-server](CommandLineSwitches.md#proxy-server)
162162
* [no-proxy-server](CommandLineSwitches.md#no-proxy-server)
163163
* [disable-gpu](CommandLineSwitches.md#disable-gpu)
164-
* [Cookie (class)](Cookie.md)
164+
* [Cookie (class)](Cookie.md#cookie-class)
165165
* [Set](Cookie.md#set)
166166
* [Get](Cookie.md#get)
167167
* [SetName](Cookie.md#setname)
@@ -184,7 +184,7 @@
184184
* [GetHasExpires](Cookie.md#gethasexpires)
185185
* [SetExpires](Cookie.md#setexpires)
186186
* [GetExpires](Cookie.md#getexpires)
187-
* [CookieManager (class)](CookieManager.md)
187+
* [CookieManager (class)](CookieManager.md#cookiemanager-class)
188188
* [GetGlobalManager](CookieManager.md#getglobalmanager)
189189
* [CreateManager](CookieManager.md#createmanager)
190190
* [SetSupportedSchemes](CookieManager.md#setsupportedschemes)
@@ -194,21 +194,21 @@
194194
* [DeleteCookies](CookieManager.md#deletecookies)
195195
* [SetStoragePath](CookieManager.md#setstoragepath)
196196
* [FlushStore](CookieManager.md#flushstore)
197-
* [CookieVisitor (interface)](CookieVisitor.md)
197+
* [CookieVisitor (interface)](CookieVisitor.md#cookievisitor-interface)
198198
* [Visit](CookieVisitor.md#visit)
199-
* [DisplayHandler (interface)](DisplayHandler.md)
199+
* [DisplayHandler (interface)](DisplayHandler.md#displayhandler-interface)
200200
* [OnAddressChange](DisplayHandler.md#onaddresschange)
201201
* [OnTitleChange](DisplayHandler.md#ontitlechange)
202202
* [OnTooltip](DisplayHandler.md#ontooltip)
203203
* [OnStatusMessage](DisplayHandler.md#onstatusmessage)
204204
* [OnConsoleMessage](DisplayHandler.md#onconsolemessage)
205-
* [DownloadHandler](DownloadHandler.md)
206-
* [DpiAware (class)](DpiAware.md)
205+
* [DownloadHandler](DownloadHandler.md#downloadhandler)
206+
* [DpiAware (class)](DpiAware.md#dpiaware-class)
207207
* [CalculateWindowSize](DpiAware.md#calculatewindowsize)
208208
* [GetSystemDpi](DpiAware.md#getsystemdpi)
209209
* [IsProcessDpiAware](DpiAware.md#isprocessdpiaware)
210210
* [SetProcessDpiAware](DpiAware.md#setprocessdpiaware)
211-
* [DragData (object)](DragData.md)
211+
* [DragData (object)](DragData.md#dragdata-object)
212212
* [IsLink](DragData.md#islink)
213213
* [IsFragment](DragData.md#isfragment)
214214
* [GetLinkUrl](DragData.md#getlinkurl)
@@ -217,11 +217,11 @@
217217
* [GetFragmentHtml](DragData.md#getfragmenthtml)
218218
* [GetImage](DragData.md#getimage)
219219
* [HasImage](DragData.md#hasimage)
220-
* [FocusHandler (interface)](FocusHandler.md)
220+
* [FocusHandler (interface)](FocusHandler.md#focushandler-interface)
221221
* [OnTakeFocus](FocusHandler.md#ontakefocus)
222222
* [OnSetFocus](FocusHandler.md#onsetfocus)
223223
* [OnGotFocus](FocusHandler.md#ongotfocus)
224-
* [Frame (object)](Frame.md)
224+
* [Frame (object)](Frame.md#frame-object)
225225
* [Copy](Frame.md#copy)
226226
* [Cut](Frame.md#cut)
227227
* [Delete](Frame.md#delete)
@@ -248,42 +248,42 @@
248248
* [SetProperty](Frame.md#setproperty)
249249
* [Undo](Frame.md#undo)
250250
* [ViewSource](Frame.md#viewsource)
251-
* [Image (object)](Image.md)
251+
* [Image (object)](Image.md#image-object)
252252
* [GetAsBitmap](Image.md#getasbitmap)
253253
* [GetAsPng](Image.md#getaspng)
254254
* [GetHeight](Image.md#getheight)
255255
* [GetWidth](Image.md#getwidth)
256-
* [JavascriptBindings (class)](JavascriptBindings.md)
256+
* [JavascriptBindings (class)](JavascriptBindings.md#javascriptbindings-class)
257257
* [\_\_init\_\_](JavascriptBindings.md#__init__)
258258
* [IsValueAllowed](JavascriptBindings.md#isvalueallowed)
259259
* [Rebind](JavascriptBindings.md#rebind)
260260
* [SetFunction](JavascriptBindings.md#setfunction)
261261
* [SetObject](JavascriptBindings.md#setobject)
262262
* [SetProperty](JavascriptBindings.md#setproperty)
263-
* [JavascriptCallback (object)](JavascriptCallback.md)
263+
* [JavascriptCallback (object)](JavascriptCallback.md#javascriptcallback-object)
264264
* [Call](JavascriptCallback.md#call)
265265
* [GetName](JavascriptCallback.md#getname)
266-
* [JavascriptDialogHandler (interface)](JavascriptDialogHandler.md)
266+
* [JavascriptDialogHandler (interface)](JavascriptDialogHandler.md#javascriptdialoghandler-interface)
267267
* [Continue](JavascriptDialogHandler.md#continue)
268268
* [OnJavascriptDialog](JavascriptDialogHandler.md#onjavascriptdialog)
269269
* [OnBeforeUnloadJavascriptDialog](JavascriptDialogHandler.md#onbeforeunloadjavascriptdialog)
270270
* [OnResetJavascriptDialogState](JavascriptDialogHandler.md#onresetjavascriptdialogstate)
271271
* [OnJavascriptDialogClosed](JavascriptDialogHandler.md#onjavascriptdialogclosed)
272-
* [KeyboardHandler (interface)](KeyboardHandler.md)
272+
* [KeyboardHandler (interface)](KeyboardHandler.md#keyboardhandler-interface)
273273
* [OnPreKeyEvent](KeyboardHandler.md#onprekeyevent)
274274
* [OnKeyEvent](KeyboardHandler.md#onkeyevent)
275-
* [LifespanHandler (interface)](LifespanHandler.md)
275+
* [LifespanHandler (interface)](LifespanHandler.md#lifespanhandler-interface)
276276
* [OnBeforePopup](LifespanHandler.md#onbeforepopup)
277277
* [_OnAfterCreated](LifespanHandler.md#_onaftercreated)
278278
* [DoClose](LifespanHandler.md#doclose)
279279
* [OnBeforeClose](LifespanHandler.md#onbeforeclose)
280-
* [LoadHandler (interface)](LoadHandler.md)
280+
* [LoadHandler (interface)](LoadHandler.md#loadhandler-interface)
281281
* [OnLoadingStateChange](LoadHandler.md#onloadingstatechange)
282282
* [OnLoadStart](LoadHandler.md#onloadstart)
283283
* [OnDomReady](LoadHandler.md#ondomready)
284284
* [OnLoadEnd](LoadHandler.md#onloadend)
285285
* [OnLoadError](LoadHandler.md#onloaderror)
286-
* [Network error](NetworkError.md)
286+
* [Network error](NetworkError.md#network-error)
287287
* [ERR_NONE](NetworkError.md#err_none)
288288
* [ERR_ABORTED](NetworkError.md#err_aborted)
289289
* [ERR_ACCESS_DENIED](NetworkError.md#err_access_denied)
@@ -333,10 +333,10 @@
333333
* [ERR_UNKNOWN_URL_SCHEME](NetworkError.md#err_unknown_url_scheme)
334334
* [ERR_UNSAFE_PORT](NetworkError.md#err_unsafe_port)
335335
* [ERR_UNSAFE_REDIRECT](NetworkError.md#err_unsafe_redirect)
336-
* [PaintBuffer (object)](PaintBuffer.md)
336+
* [PaintBuffer (object)](PaintBuffer.md#paintbuffer-object)
337337
* [GetIntPointer](PaintBuffer.md#getintpointer)
338338
* [GetString](PaintBuffer.md#getstring)
339-
* [RenderHandler (interface)](RenderHandler.md)
339+
* [RenderHandler (interface)](RenderHandler.md#renderhandler-interface)
340340
* [GetRootScreenRect](RenderHandler.md#getrootscreenrect)
341341
* [GetViewRect](RenderHandler.md#getviewrect)
342342
* [GetScreenRect](RenderHandler.md#getscreenrect)
@@ -348,7 +348,7 @@
348348
* [OnScrollOffsetChanged](RenderHandler.md#onscrolloffsetchanged)
349349
* [StartDragging](RenderHandler.md#startdragging)
350350
* [UpdateDragCursor](RenderHandler.md#updatedragcursor)
351-
* [Request (class)](Request.md)
351+
* [Request (class)](Request.md#request-class)
352352
* [CreateRequest](Request.md#createrequest)
353353
* [IsReadOnly](Request.md#isreadonly)
354354
* [GetUrl](Request.md#geturl)
@@ -367,7 +367,7 @@
367367
* [SetFirstPartyForCookies](Request.md#setfirstpartyforcookies)
368368
* [GetResourceType](Request.md#getresourcetype)
369369
* [GetTransitionType](Request.md#gettransitiontype)
370-
* [RequestHandler (interface)](RequestHandler.md)
370+
* [RequestHandler (interface)](RequestHandler.md#requesthandler-interface)
371371
* [OnBeforeBrowse](RequestHandler.md#onbeforebrowse)
372372
* [OnBeforeResourceLoad](RequestHandler.md#onbeforeresourceload)
373373
* [GetResourceHandler](RequestHandler.md#getresourcehandler)
@@ -381,14 +381,14 @@
381381
* [_OnCertificateError](RequestHandler.md#_oncertificateerror)
382382
* [OnRendererProcessTerminated](RequestHandler.md#onrendererprocessterminated)
383383
* [OnPluginCrashed](RequestHandler.md#onplugincrashed)
384-
* [ResourceHandler (interface)](ResourceHandler.md)
384+
* [ResourceHandler (interface)](ResourceHandler.md#resourcehandler-interface)
385385
* [ProcessRequest](ResourceHandler.md#processrequest)
386386
* [GetResponseHeaders](ResourceHandler.md#getresponseheaders)
387387
* [ReadResponse](ResourceHandler.md#readresponse)
388388
* [CanGetCookie](ResourceHandler.md#cangetcookie)
389389
* [CanSetCookie](ResourceHandler.md#cansetcookie)
390390
* [Cancel](ResourceHandler.md#cancel)
391-
* [Response (object)](Response.md)
391+
* [Response (object)](Response.md#response-object)
392392
* [IsReadOnly](Response.md#isreadonly)
393393
* [GetStatus](Response.md#getstatus)
394394
* [SetStatus](Response.md#setstatus)
@@ -401,35 +401,35 @@
401401
* [GetHeaderMultimap](Response.md#getheadermultimap)
402402
* [SetHeaderMap](Response.md#setheadermap)
403403
* [SetHeaderMultimap](Response.md#setheadermultimap)
404-
* [StringVisitor (interface)](StringVisitor.md)
404+
* [StringVisitor (interface)](StringVisitor.md#stringvisitor-interface)
405405
* [Visit](StringVisitor.md#visit)
406-
* [V8ContextHandler (interface)](V8ContextHandler.md)
406+
* [V8ContextHandler (interface)](V8ContextHandler.md#v8contexthandler-interface)
407407
* [OnContextCreated](V8ContextHandler.md#oncontextcreated)
408408
* [OnContextReleased](V8ContextHandler.md#oncontextreleased)
409-
* [Virtual Key codes](VirtualKey.md)
410-
* [WebPluginInfo (object)](WebPluginInfo.md)
409+
* [Virtual Key codes](VirtualKey.md#virtual-key-codes)
410+
* [WebPluginInfo (object)](WebPluginInfo.md#webplugininfo-object)
411411
* [GetName](WebPluginInfo.md#getname)
412412
* [GetPath](WebPluginInfo.md#getpath)
413413
* [GetVersion](WebPluginInfo.md#getversion)
414414
* [GetDescription](WebPluginInfo.md#getdescription)
415-
* [WebRequest (class)](WebRequest.md)
415+
* [WebRequest (class)](WebRequest.md#webrequest-class)
416416
* [Create](WebRequest.md#create)
417417
* [GetRequest](WebRequest.md#getrequest)
418418
* [GetRequestStatus](WebRequest.md#getrequeststatus)
419419
* [GetRequestError](WebRequest.md#getrequesterror)
420420
* [GetResponse](WebRequest.md#getresponse)
421421
* [Cancel](WebRequest.md#cancel)
422-
* [WebRequestClient (interface)](WebRequestClient.md)
422+
* [WebRequestClient (interface)](WebRequestClient.md#webrequestclient-interface)
423423
* [OnUploadProgress](WebRequestClient.md#onuploadprogress)
424424
* [OnDownloadProgress](WebRequestClient.md#ondownloadprogress)
425425
* [OnDownloadData](WebRequestClient.md#ondownloaddata)
426426
* [OnRequestComplete](WebRequestClient.md#onrequestcomplete)
427-
* [WindowInfo (class)](WindowInfo.md)
427+
* [WindowInfo (class)](WindowInfo.md#windowinfo-class)
428428
* [SetAsChild](WindowInfo.md#setaschild)
429429
* [SetAsPopup](WindowInfo.md#setaspopup)
430430
* [SetAsOffscreen](WindowInfo.md#setasoffscreen)
431431
* [SetTransparentPainting](WindowInfo.md#settransparentpainting)
432-
* [WindowUtils (class)](WindowUtils.md)
432+
* [WindowUtils (class)](WindowUtils.md#windowutils-class)
433433
* [OnSetFocus ](WindowUtils.md#onsetfocus-win)
434434
* [OnSize ](WindowUtils.md#onsize-win)
435435
* [OnEraseBackground ](WindowUtils.md#onerasebackground-win)

docs/API.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# API
2+
3+
API reference is available in the root [api/](../api) directory.

docs/Knowledge-Base.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Table of contents:
1010
* [How to capture Audio and Video in HTML5?](#how-to-capture-audio-and-video-in-html5)
1111
* [Touch and multi-touch support](#touch-and-multi-touch-support)
1212
* [Black or white browser screen](#black-or-white-browser-screen)
13+
* [Python crashes with "Segmentation fault" - how to debug?](#python-crashes-with-segmentation-fault-how-to-debug)
1314
* [Windows XP support](#windows-xp-support)
1415
* [Mac 32-bit support](#mac-32-bit-support)
1516
* [Security](#security)
@@ -164,6 +165,59 @@ appear even after disabling GPU hardware acceleration. This is normal
164165
because GPU was disabled so WebGL cannot work.
165166

166167

168+
## How to enable debug information in examples?
169+
170+
You can pass "--debug" command line flag to any of CEF Python
171+
examples and unit tests. It will also work with your app, as
172+
this feature is enabled in CEF Python's core. When this flag is
173+
passed the following settings will be set:
174+
```
175+
settings = {"debug": True, "log_severity": cef.LOGSEVERITY_WARNING}
176+
cef.Initialize(settings=settings)
177+
```
178+
179+
Now you should see debug information displayed in console like this:
180+
```
181+
[CEF Python] Initialize() called
182+
[CEF Python] CefExecuteProcess(): exitCode = -1
183+
[CEF Python] CefInitialize()
184+
[CEF Python] App_OnBeforeCommandLineProcessing_BrowserProcess()
185+
[CEF Python] Command line string for the browser process: ...
186+
```
187+
188+
189+
## Python crashes with "Segmentation fault" - how to debug?
190+
191+
Install gdb:
192+
- On Linux type: `sudo apt-get install gdb`
193+
- On Mac type: `brew install gdb` and then [sign gdb]
194+
(https://sourceware.org/gdb/wiki/BuildingOnDarwin#Giving_gdb_permission_to_control_other_processes)
195+
- Additionally on Mac to get a meaningful stack trace with gdb do these steps:
196+
- Install [macports](https://www.macports.org/install.php)
197+
and restart terminal
198+
- Type `sudo port install gdb-apple`
199+
- Type `sudo codesign -s "gdb-cert" /opt/local/bin/gdb-apple`
200+
- Type `/opt/local/bin/gdb-apple python`
201+
202+
Run python script using gdb:
203+
```
204+
gdb python
205+
run tkinter_.py
206+
```
207+
208+
On segmentation fault to display stack trace type:
209+
```
210+
bt
211+
```
212+
213+
On Mac to use lldb:
214+
```
215+
lldb python
216+
run tkinter_.py
217+
bt
218+
```
219+
220+
167221
## Windows XP support
168222

169223
CEF Python v31.2 was the last version to support Windows XP. This is

0 commit comments

Comments
 (0)