File tree 3 files changed +12
-12
lines changed
3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 23
23
- jsonrpc: add ` is_broadcast ` property to ` ChatListItemFetchResult ` #3584
24
24
- jsonrpc: add ` was_seen_recently ` property to ` ChatListItemFetchResult ` , ` FullChat ` and ` Contact ` #3584
25
25
- jsonrpc: add ` webxdc_info ` property to ` Message ` #3588
26
+ - python: move ` get_dc_event_name() ` from ` deltachat ` to ` deltachat.events ` #3564
26
27
27
28
### Changes
28
29
- order contact lists by "last seen";
Original file line number Diff line number Diff line change 2
2
3
3
from pkg_resources import DistributionNotFound , get_distribution
4
4
5
- from . import capi , const , events , hookspec # noqa
5
+ from . import capi , events , hookspec # noqa
6
6
from .account import Account , get_core_info # noqa
7
7
from .capi import ffi # noqa
8
8
from .chat import Chat # noqa
17
17
__version__ = "0.0.0.dev0-unknown"
18
18
19
19
20
- def get_dc_event_name (integer , _DC_EVENTNAME_MAP = {}):
21
- if not _DC_EVENTNAME_MAP :
22
- for name in dir (const ):
23
- if name .startswith ("DC_EVENT_" ):
24
- _DC_EVENTNAME_MAP [getattr (const , name )] = name
25
- return _DC_EVENTNAME_MAP [integer ]
26
-
27
-
28
20
def register_global_plugin (plugin ):
29
21
"""Register a global plugin which implements one or more
30
22
of the :class:`deltachat.hookspec.Global` hooks.
Original file line number Diff line number Diff line change 8
8
from contextlib import contextmanager
9
9
from queue import Empty , Queue
10
10
11
- import deltachat
12
-
11
+ from . import const
13
12
from .capi import ffi , lib
14
13
from .cutil import from_optional_dc_charpointer
15
14
from .hookspec import account_hookimpl
16
15
from .message import map_system_message
17
16
18
17
18
+ def get_dc_event_name (integer , _DC_EVENTNAME_MAP = {}):
19
+ if not _DC_EVENTNAME_MAP :
20
+ for name in dir (const ):
21
+ if name .startswith ("DC_EVENT_" ):
22
+ _DC_EVENTNAME_MAP [getattr (const , name )] = name
23
+ return _DC_EVENTNAME_MAP [integer ]
24
+
25
+
19
26
class FFIEvent :
20
27
def __init__ (self , name : str , data1 , data2 ):
21
28
self .name = name
@@ -239,7 +246,7 @@ def _inner_run(self):
239
246
data1 = lib .dc_event_get_data1_int (event )
240
247
# the following code relates to the deltachat/_build.py's helper
241
248
# function which provides us signature info of an event call
242
- evt_name = deltachat . get_dc_event_name (evt )
249
+ evt_name = get_dc_event_name (evt )
243
250
if lib .dc_event_has_string_data (evt ):
244
251
data2 = from_optional_dc_charpointer (lib .dc_event_get_data2_str (event ))
245
252
else :
You can’t perform that action at this time.
0 commit comments