mirror of
https://github.com/chatmail/core.git
synced 2026-05-23 00:36:32 +03:00
Update instructions on using ipython
This commit is contained in:
@@ -17,17 +17,24 @@ Additional arguments to `tox` are passed to pytest, e.g. `tox -- -s` does not ca
|
|||||||
|
|
||||||
## Using in REPL
|
## Using in REPL
|
||||||
|
|
||||||
|
Setup a development environment:
|
||||||
|
```
|
||||||
|
$ tox --devenv env
|
||||||
|
$ . env/bin/activate
|
||||||
|
```
|
||||||
|
|
||||||
It is recommended to use IPython, because it supports using `await` directly
|
It is recommended to use IPython, because it supports using `await` directly
|
||||||
from the REPL.
|
from the REPL.
|
||||||
|
|
||||||
```
|
```
|
||||||
PATH="../target/debug:$PATH" ipython
|
$ pip install ipython
|
||||||
|
$ PATH="../target/debug:$PATH" ipython
|
||||||
...
|
...
|
||||||
In [1]: from deltachat_rpc_client import *
|
In [1]: from deltachat_rpc_client import *
|
||||||
In [2]: dc = Deltachat(await start_rpc_server())
|
In [2]: rpc_generator = start_rpc_server()
|
||||||
In [3]: await dc.get_all_accounts()
|
In [3]: rpc = await rpc_generator.__aenter__()
|
||||||
Out [3]: []
|
In [4]: dc = Deltachat(rpc)
|
||||||
In [4]: alice = await dc.add_account()
|
In [5]: system_info = await dc.get_system_info()
|
||||||
In [5]: (await alice.get_info())["journal_mode"]
|
In [6]: system_info["level"]
|
||||||
Out [5]: 'wal'
|
Out [6]: 'awesome'
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user