diff --git a/python/CHANGELOG b/python/CHANGELOG index 108abeb7..6ef486e5 100644 --- a/python/CHANGELOG +++ b/python/CHANGELOG @@ -1,3 +1,9 @@ +0.7.1 +----- + +- add Account.get_infostring() to show low-level info about account state + + 0.7 --- diff --git a/python/setup.cfg b/python/setup.cfg index 99934e46..7a99ba71 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,3 +1,6 @@ [devpi:upload] formats = sdist.tgz no-vcs = 1 + +[bdist_wheel] +universal = 1 diff --git a/python/src/deltachat/__init__.py b/python/src/deltachat/__init__.py index e2fad9bb..c8fe3874 100644 --- a/python/src/deltachat/__init__.py +++ b/python/src/deltachat/__init__.py @@ -2,7 +2,7 @@ from deltachat import capi, const from deltachat.capi import ffi from deltachat.account import Account # noqa -__version__ = "0.7.0" +__version__ = "0.7.1" _DC_CALLBACK_MAP = {} diff --git a/python/src/deltachat/account.py b/python/src/deltachat/account.py index ec54163a..7eef2dd2 100644 --- a/python/src/deltachat/account.py +++ b/python/src/deltachat/account.py @@ -96,6 +96,11 @@ class Account(object): if not self.is_configured(): raise ValueError("need to configure first") + def get_infostring(self): + """ return info of the configured account. """ + self.check_is_configured() + return from_dc_charpointer(lib.dc_get_info(self._dc_context)) + def get_self_contact(self): """ return this account's identity as a :class:`deltachat.chatting.Contact`. diff --git a/python/tests/test_account.py b/python/tests/test_account.py index bfe4e9f2..f2185c6d 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -18,6 +18,11 @@ class TestOfflineAccount: with pytest.raises(ValueError): ac1.get_self_contact() + def test_get_info(self, acfactory): + ac1 = acfactory.get_configured_offline_account() + out = ac1.get_infostring() + assert "number_of_chats=0" in out + def test_selfcontact_configured(self, acfactory): ac1 = acfactory.get_configured_offline_account() me = ac1.get_self_contact()