mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-06 03:50:08 +02:00
do some string conversions less hackish and address one review comment on how to call the callback and return results
This commit is contained in:
parent
aab06cda70
commit
1ff06c071b
4 changed files with 56 additions and 23 deletions
|
@ -13,9 +13,10 @@ def py_dc_callback(ctx, evt, data1, data2):
|
|||
looks up the correct event handler for the given context.
|
||||
"""
|
||||
callback = _DC_CALLBACK_MAP.get(ctx, lambda *a: 0)
|
||||
ret = callback(ctx, evt, data1, data2)
|
||||
if ret is None:
|
||||
return 0
|
||||
try:
|
||||
ret = callback(ctx, evt, data1, data2)
|
||||
except:
|
||||
ret = 0
|
||||
return ret
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue