Coverage for slidge/core/mixins/base.py: 95%
19 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-11-07 05:11 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-11-07 05:11 +0000
1from abc import ABCMeta
2from typing import TYPE_CHECKING
4from slixmpp import JID
6from ...util.types import MessageOrPresenceTypeVar
8if TYPE_CHECKING:
9 from ..gateway import BaseGateway
10 from ..session import BaseSession
13class MetaBase(ABCMeta):
14 pass
17class Base:
18 session: "BaseSession" = NotImplemented
19 xmpp: "BaseGateway" = NotImplemented
21 jid: JID = NotImplemented
22 name: str = NotImplemented
24 @property
25 def user_jid(self):
26 return self.session.user_jid
28 @property
29 def user_pk(self):
30 return self.session.user_pk
33class BaseSender(Base):
34 def _send(
35 self, stanza: MessageOrPresenceTypeVar, **send_kwargs
36 ) -> MessageOrPresenceTypeVar:
37 raise NotImplementedError