From 2ea5e3a1c970b4b4293a8918fdc38905e204cfa8 Mon Sep 17 00:00:00 2001 From: lovetox <philipp@hoerist.com> Date: Sat, 18 Apr 2020 11:58:32 +0200 Subject: [PATCH] Annotate variable --- gajim/common/app.py | 3 ++- gajim/common/types.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gajim/common/app.py b/gajim/common/app.py index ed8f145b73..783381c25d 100644 --- a/gajim/common/app.py +++ b/gajim/common/app.py @@ -51,6 +51,7 @@ from gajim.common.types import InterfaceT # pylint: disable=unused-import from gajim.common.types import LoggerT # pylint: disable=unused-import from gajim.common.types import ConnectionT # pylint: disable=unused-import +from gajim.common.types import LegacyContactsAPIT # pylint: disable=unused-import interface = cast(InterfaceT, None) thread_interface = lambda *args: None # Interface to run a thread and then a callback @@ -78,7 +79,7 @@ # {acct1: {jid1: time1, jid2: time2}, } last_message_time = {} # type: Dict[str, Dict[str, float]] -contacts = None +contacts = cast(LegacyContactsAPIT, None) # tell if we are connected to the room or not # {acct: {room_jid: True}} diff --git a/gajim/common/types.py b/gajim/common/types.py index e0f3b0c253..71f7012319 100644 --- a/gajim/common/types.py +++ b/gajim/common/types.py @@ -32,6 +32,7 @@ from gajim.common.zeroconf.connection_zeroconf import ConnectionZeroconf from gajim.common.contacts import Contact from gajim.common.contacts import GC_Contact + from gajim.common.contacts import LegacyContactsAPI from gajim.common.nec import NetworkEvent from gajim.common.nec import NetworkEventsController from gajim.common.logger import Logger @@ -46,6 +47,7 @@ ConnectionT = Union['Client', 'ConnectionZeroconf'] ContactsT = Union['Contact', 'GC_Contact'] ContactT = Union['Contact'] +LegacyContactsAPIT = Union['LegacyContactsAPI'] # PEP PEPNotifyCallback = Callable[[nbxmpp.JID, nbxmpp.Node], None] -- GitLab