diff libervia/backend/plugins/plugin_xep_0166/models.py @ 4270:0d7bb4df2343

Reformatted code base using black.
author Goffi <goffi@goffi.org>
date Wed, 19 Jun 2024 18:44:57 +0200
parents 79c8a70e1813
children
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0166/models.py	Tue Jun 18 12:06:45 2024 +0200
+++ b/libervia/backend/plugins/plugin_xep_0166/models.py	Wed Jun 19 18:44:57 2024 +0200
@@ -28,14 +28,12 @@
 from libervia.backend.core.core_types import SatXMPPEntity
 from libervia.backend.core.i18n import _
 
+
 class BaseApplicationHandler(abc.ABC):
 
     @abc.abstractmethod
     async def jingle_preflight(
-        self,
-        client: SatXMPPEntity,
-        session: dict,
-        description_elt: domish.Element
+        self, client: SatXMPPEntity, session: dict, description_elt: domish.Element
     ) -> None:
         """Called when preparation steps are needed by a plugin
 
@@ -49,7 +47,7 @@
         client: SatXMPPEntity,
         session: dict,
         info_type: str,
-        info_data: dict|None = None
+        info_data: dict | None = None,
     ) -> None:
         """Called when we have new information during preflight
 
@@ -59,10 +57,7 @@
 
     @abc.abstractmethod
     async def jingle_preflight_cancel(
-        self,
-        client: SatXMPPEntity,
-        session: dict,
-        cancel_error: exceptions.CancelError
+        self, client: SatXMPPEntity, session: dict, cancel_error: exceptions.CancelError
     ) -> None:
         """Called when preflight initiation is cancelled
 
@@ -79,8 +74,7 @@
         content_name: str,
         desc_elt: domish.Element,
     ) -> Union[
-        Callable[..., Union[bool, defer.Deferred]],
-        Callable[..., Awaitable[bool]]
+        Callable[..., Union[bool, defer.Deferred]], Callable[..., Awaitable[bool]]
     ]:
         """If present, it is called on when session must be accepted.
         If not present, a generic accept dialog will be used.
@@ -94,15 +88,8 @@
 
     @abc.abstractmethod
     def jingle_session_init(
-        self,
-        client: SatXMPPEntity,
-        session: dict,
-        content_name: str,
-        *args, **kwargs
-    ) -> Union[
-        Callable[..., domish.Element],
-        Callable[..., Awaitable[domish.Element]]
-    ]:
+        self, client: SatXMPPEntity, session: dict, content_name: str, *args, **kwargs
+    ) -> Union[Callable[..., domish.Element], Callable[..., Awaitable[domish.Element]]]:
         """Must return the domish.Element used for initial content.
 
         @param client: SatXMPPEntity instance
@@ -119,11 +106,8 @@
         action: str,
         session: dict,
         content_name: str,
-        transport_elt: domish.Element
-    ) -> Union[
-        Callable[..., None],
-        Callable[..., Awaitable[None]]
-    ]:
+        transport_elt: domish.Element,
+    ) -> Union[Callable[..., None], Callable[..., Awaitable[None]]]:
         """Called on several actions to negotiate the application or transport.
 
         @param client: SatXMPPEntity instance
@@ -141,11 +125,8 @@
         action: str,
         session: dict,
         content_name: str,
-        reason_elt: domish.Element
-    ) -> Union[
-        Callable[..., None],
-        Callable[..., Awaitable[None]]
-    ]:
+        reason_elt: domish.Element,
+    ) -> Union[Callable[..., None], Callable[..., Awaitable[None]]]:
         """Called on session terminate, with reason_elt.
         May be used to clean session.
 
@@ -170,15 +151,8 @@
 
     @abc.abstractmethod
     def jingle_session_init(
-        self,
-        client: SatXMPPEntity,
-        session: dict,
-        content_name: str,
-        *args, **kwargs
-    ) -> Union[
-        Callable[..., domish.Element],
-        Callable[..., Awaitable[domish.Element]]
-    ]:
+        self, client: SatXMPPEntity, session: dict, content_name: str, *args, **kwargs
+    ) -> Union[Callable[..., domish.Element], Callable[..., Awaitable[domish.Element]]]:
         """Must return the domish.Element used for initial content.
 
         @param client: SatXMPPEntity instance
@@ -195,11 +169,8 @@
         action: str,
         session: dict,
         content_name: str,
-        reason_elt: domish.Element
-    ) -> Union[
-        Callable[..., None],
-        Callable[..., Awaitable[None]]
-    ]:
+        reason_elt: domish.Element,
+    ) -> Union[Callable[..., None], Callable[..., Awaitable[None]]]:
         """Called on several actions to negotiate the application or transport.
 
         @param client: SatXMPPEntity instance