deltachat-rpc-client 2.26.0__py3-none-any.whl → 2.27.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -417,12 +417,21 @@ class Account:
417
417
  """Wait for messages noticed event and return it."""
418
418
  return self.wait_for_event(EventType.MSGS_NOTICED)
419
419
 
420
+ def wait_for_msg(self, event_type) -> Message:
421
+ """Wait for an event about the message.
422
+
423
+ Consumes all events before the matching event.
424
+ Returns a message corresponding to the msg_id field of the event.
425
+ """
426
+ event = self.wait_for_event(event_type)
427
+ return self.get_message_by_id(event.msg_id)
428
+
420
429
  def wait_for_incoming_msg(self):
421
430
  """Wait for incoming message and return it.
422
431
 
423
432
  Consumes all events before the next incoming message event.
424
433
  """
425
- return self.get_message_by_id(self.wait_for_incoming_msg_event().msg_id)
434
+ return self.wait_for_msg(EventType.INCOMING_MSG)
426
435
 
427
436
  def wait_for_securejoin_inviter_success(self):
428
437
  """Wait until SecureJoin process finishes successfully on the inviter side."""
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  from typing import TYPE_CHECKING
6
6
 
7
- from ._utils import AttrDict
7
+ from ._utils import AttrDict, futuremethod
8
8
  from .account import Account
9
9
 
10
10
  if TYPE_CHECKING:
@@ -39,6 +39,15 @@ class DeltaChat:
39
39
  """Stop the I/O of all accounts."""
40
40
  self.rpc.stop_io_for_all_accounts()
41
41
 
42
+ @futuremethod
43
+ def background_fetch(self, timeout_in_seconds: int) -> None:
44
+ """Run background fetch for all accounts."""
45
+ yield self.rpc.background_fetch.future(timeout_in_seconds)
46
+
47
+ def stop_background_fetch(self) -> None:
48
+ """Stop ongoing background fetch."""
49
+ self.rpc.stop_background_fetch()
50
+
42
51
  def maybe_network(self) -> None:
43
52
  """Indicate that the network conditions might have changed."""
44
53
  self.rpc.maybe_network()
@@ -135,9 +135,15 @@ def rpc(tmp_path) -> AsyncGenerator:
135
135
 
136
136
 
137
137
  @pytest.fixture
138
- def acfactory(rpc) -> AsyncGenerator:
138
+ def dc(rpc) -> DeltaChat:
139
+ """Return account manager."""
140
+ return DeltaChat(rpc)
141
+
142
+
143
+ @pytest.fixture
144
+ def acfactory(dc) -> AsyncGenerator:
139
145
  """Return account factory fixture."""
140
- return ACFactory(DeltaChat(rpc))
146
+ return ACFactory(dc)
141
147
 
142
148
 
143
149
  @pytest.fixture
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 2.26.0
3
+ Version: 2.27.0
4
4
  Summary: Python client for Delta Chat core JSON-RPC interface
5
5
  Classifier: Development Status :: 5 - Production/Stable
6
6
  Classifier: Intended Audience :: Developers
@@ -1,19 +1,19 @@
1
1
  deltachat_rpc_client/__init__.py,sha256=zroJARiq9HBi7Ln03KlICOUJHSjm3CGIFkHfXILEdOQ,567
2
2
  deltachat_rpc_client/_utils.py,sha256=v0iWVSa6S-s078GgnnhflCRhA9pfWI-CfK8mjZ4zjXc,6393
3
- deltachat_rpc_client/account.py,sha256=R8lthfdyZtQrje5WLd42lnReOAgxKk7dEIZyZfYKe40,19103
3
+ deltachat_rpc_client/account.py,sha256=itF7QYR9m26ImyuOVbUtCj7AMkHu6_PMyiKTto_Z4K0,19421
4
4
  deltachat_rpc_client/chat.py,sha256=x5CEIORL1-731QC4KcXd_0JKtRpe7nT9oAygmKkooHI,11707
5
5
  deltachat_rpc_client/client.py,sha256=6eP_lH5z7G5Sy7vDRNfKNY3dkUqJqKZDVyCGjynsuW8,7181
6
6
  deltachat_rpc_client/const.py,sha256=p6hSXNYLBpPLpMz0UkT8QnMrqmA_cZ3sw-o8S3ryVM4,6675
7
7
  deltachat_rpc_client/contact.py,sha256=NLh1XNnD_LQf27pNcVgqNN97Gbv190VSCuEyjjce4L4,1893
8
- deltachat_rpc_client/deltachat.py,sha256=4KpiHbpfXM_LmbG-OvtDACK9W09UH0tsJyFunfH9TR4,1544
8
+ deltachat_rpc_client/deltachat.py,sha256=-6SqQAS8_mMWLBP3U1HvFsNIpcAPYBlmqF8R6Bt90YQ,1894
9
9
  deltachat_rpc_client/events.py,sha256=Y45LoGlQy0i1U-LhoqF9njqJWA8v4b-XHfXZ4VOr1TQ,10205
10
10
  deltachat_rpc_client/message.py,sha256=PWSm5e-woWgYXPcnwygQO0fNSRV-NvKvuerqWkJxiik,4996
11
11
  deltachat_rpc_client/py.typed,sha256=nGQ9Itq-bkXBn5Ri1JIR0oYnDNv7LDRfkowxBSSqVTM,60
12
- deltachat_rpc_client/pytestplugin.py,sha256=LINsTZ-ICKhUzvjmrJe7kZsJAAj5wGA5btbH1vkDGWY,5622
12
+ deltachat_rpc_client/pytestplugin.py,sha256=gM5b9UL6d7ktRbu-1pyaRkg22m0qHT_wrP1ypHsgk2U,5713
13
13
  deltachat_rpc_client/rpc.py,sha256=AUY8UJP7NlRSE5ewJs9jGxJdK8etKqsCEFWiIqnX5T8,6981
14
- deltachat_rpc_client-2.26.0.dist-info/licenses/LICENSE,sha256=Pz2eACSxkhsGfW9_iN60pgy-enjnbGTj8df8O3ebnQQ,16726
15
- deltachat_rpc_client-2.26.0.dist-info/METADATA,sha256=NYktAx-rwDr8BsXaKgpzkBHpoXfiO0SeOo51mVneAPA,2225
16
- deltachat_rpc_client-2.26.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- deltachat_rpc_client-2.26.0.dist-info/entry_points.txt,sha256=VHpX6EnKBaNj89qJWctApThnMa8suyaamfZEnQacXgc,81
18
- deltachat_rpc_client-2.26.0.dist-info/top_level.txt,sha256=ePNMkY10htGrLiLydH1ITvYFM3LcTEa51HyPqJ40hDk,21
19
- deltachat_rpc_client-2.26.0.dist-info/RECORD,,
14
+ deltachat_rpc_client-2.27.0.dist-info/licenses/LICENSE,sha256=Pz2eACSxkhsGfW9_iN60pgy-enjnbGTj8df8O3ebnQQ,16726
15
+ deltachat_rpc_client-2.27.0.dist-info/METADATA,sha256=rz3CihD8i9mg6tUEJbVs7DXD-nB_oKRSzndPI0qLZQY,2225
16
+ deltachat_rpc_client-2.27.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ deltachat_rpc_client-2.27.0.dist-info/entry_points.txt,sha256=VHpX6EnKBaNj89qJWctApThnMa8suyaamfZEnQacXgc,81
18
+ deltachat_rpc_client-2.27.0.dist-info/top_level.txt,sha256=ePNMkY10htGrLiLydH1ITvYFM3LcTEa51HyPqJ40hDk,21
19
+ deltachat_rpc_client-2.27.0.dist-info/RECORD,,