comparison libervia/backend/core/core_types.py @ 4270:0d7bb4df2343

Reformatted code base using black.
author Goffi <goffi@goffi.org>
date Wed, 19 Jun 2024 18:44:57 +0200
parents c38c33a44171
children 96fdf4891747
comparison
equal deleted inserted replaced
4269:64a85ce8be70 4270:0d7bb4df2343
32 is_admin: bool 32 is_admin: bool
33 is_component: bool 33 is_component: bool
34 server_jid: t_jid.JID 34 server_jid: t_jid.JID
35 IQ: Callable[[Optional[str], Optional[int]], xmlstream.IQ] 35 IQ: Callable[[Optional[str], Optional[int]], xmlstream.IQ]
36 36
37 EncryptionPlugin = namedtuple("EncryptionPlugin", ("instance", 37
38 "name", 38 EncryptionPlugin = namedtuple(
39 "namespace", 39 "EncryptionPlugin", ("instance", "name", "namespace", "priority", "directed")
40 "priority", 40 )
41 "directed"))
42 41
43 42
44 class EncryptionSession(TypedDict): 43 class EncryptionSession(TypedDict):
45 plugin: EncryptionPlugin 44 plugin: EncryptionPlugin
46 45
47 46
48 # Incomplete types built through observation rather than code inspection. 47 # Incomplete types built through observation rather than code inspection.
49 MessageDataExtra = TypedDict( 48 MessageDataExtra = TypedDict(
50 "MessageDataExtra", 49 "MessageDataExtra", {"encrypted": bool, "origin_id": str}, total=False
51 { "encrypted": bool, "origin_id": str },
52 total=False
53 ) 50 )
54 51
55 52
56 MessageData = TypedDict("MessageData", { 53 MessageData = TypedDict(
57 "from": t_jid.JID, 54 "MessageData",
58 "to": t_jid.JID, 55 {
59 "uid": str, 56 "from": t_jid.JID,
60 "message": Dict[str, str], 57 "to": t_jid.JID,
61 "subject": Dict[str, str], 58 "uid": str,
62 "type": str, 59 "message": Dict[str, str],
63 "timestamp": float, 60 "subject": Dict[str, str],
64 "extra": MessageDataExtra, 61 "type": str,
65 "ENCRYPTION": EncryptionSession, 62 "timestamp": float,
66 "xml": domish.Element 63 "extra": MessageDataExtra,
67 }, total=False) 64 "ENCRYPTION": EncryptionSession,
65 "xml": domish.Element,
66 },
67 total=False,
68 )