Reformatted code base using black.

This commit is contained in:
Goffi 2024-06-19 18:44:57 +02:00
commit 53fdaa9d09

View file

@ -28,14 +28,12 @@ from libervia.backend.core import exceptions
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 @@ class BaseApplicationHandler(abc.ABC):
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 @@ class BaseApplicationHandler(abc.ABC):
@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 @@ class BaseApplicationHandler(abc.ABC):
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 @@ class BaseApplicationHandler(abc.ABC):
@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 @@ class BaseApplicationHandler(abc.ABC):
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 @@ class BaseApplicationHandler(abc.ABC):
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 @@ class BaseTransportHandler(abc.ABC):
@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 @@ class BaseTransportHandler(abc.ABC):
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