diff libervia/cli/cmd_call.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/cli/cmd_call.py	Tue Jun 18 12:06:45 2024 +0200
+++ b/libervia/cli/cmd_call.py	Wed Jun 19 18:44:57 2024 +0200
@@ -37,7 +37,6 @@
 
 class Common(base.CommandBase):
 
-
     def __init__(self, *args, **kwargs):
         super().__init__(
             *args,
@@ -52,7 +51,7 @@
                 #: experimental TUI output
                 "tui": partial(self.use_output, "tui"),
             },
-            **kwargs
+            **kwargs,
         )
 
     def add_parser_options(self):
@@ -61,8 +60,11 @@
         )
         sources_group = self.parser.add_mutually_exclusive_group()
         sources_group.add_argument(
-            "-s", "--sources", choices=['auto', 'test'], default='auto',
-            help='Well-known sources to use (default: "auto").'
+            "-s",
+            "--sources",
+            choices=["auto", "test"],
+            default="auto",
+            help='Well-known sources to use (default: "auto").',
         )
 
     def get_call_data_kw(self) -> dict[str, Any]:
@@ -70,10 +72,10 @@
         kwargs: dict[str, Any] = {}
         if self.args.sources == "test":
             from libervia.frontends.tools.webrtc_models import SourcesTest
+
             kwargs["sources_data"] = SourcesTest()
         return kwargs
 
-
     async def start(self):
         root_logger = logging.getLogger()
         # we don't want any formatting for messages from webrtc
@@ -133,10 +135,9 @@
 
     async def start(self):
         await super().start()
-        await super().output(CallData(
-            callee=jid.JID(self.args.entity),
-            kwargs=self.get_call_data_kw()
-        ))
+        await super().output(
+            CallData(callee=jid.JID(self.args.entity), kwargs=self.get_call_data_kw())
+        )
 
 
 class Receive(Common):
@@ -157,12 +158,14 @@
             action="append",
             metavar="JID",
             default=[],
-            help=_("automatically accept call from this jid (can be used multiple times)")
+            help=_(
+                "automatically accept call from this jid (can be used multiple times)"
+            ),
         )
         auto_accept_group.add_argument(
             "--auto-accept-all",
             action="store_true",
-            help=_("automatically accept call from anybody")
+            help=_("automatically accept call from anybody"),
         )
 
     async def on_action_new(
@@ -179,9 +182,7 @@
             not self.args.auto_accept_all
             and caller not in self.args.auto_accept
             and not await self.host.confirm(
-                _("📞 Incoming call from {caller}, do you accept?").format(
-                    caller=caller
-                )
+                _("📞 Incoming call from {caller}, do you accept?").format(caller=caller)
             )
         ):
             await self.host.bridge.action_launch(
@@ -191,12 +192,14 @@
 
         self.disp(_("✅ Incoming call from {caller} accepted.").format(caller=caller))
 
-        await super().output(CallData(
-            callee=peer_jid,
-            sid=action_data["session_id"],
-            action_id=action_id,
-            kwargs=self.get_call_data_kw()
-        ))
+        await super().output(
+            CallData(
+                callee=peer_jid,
+                sid=action_data["session_id"],
+                action_id=action_id,
+                kwargs=self.get_call_data_kw(),
+            )
+        )
 
     async def start(self):
         await super().start()