diff libervia/frontends/tools/webrtc_file.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/frontends/tools/webrtc_file.py	Tue Jun 18 12:06:45 2024 +0200
+++ b/libervia/frontends/tools/webrtc_file.py	Wed Jun 19 18:44:57 2024 +0200
@@ -130,7 +130,7 @@
 
     async def send_file_webrtc(
         self,
-        file_path: Path|str,
+        file_path: Path | str,
         callee: jid.JID,
         file_name: str | None = None,
     ) -> None:
@@ -178,9 +178,7 @@
 
     @staticmethod
     def format_confirm_msg(
-        action_data: dict,
-        peer_jid: jid.JID,
-        peer_name: str|None = None
+        action_data: dict, peer_jid: jid.JID, peer_name: str | None = None
     ) -> str:
         """Format a user-friendly confirmation message.
 
@@ -191,15 +189,15 @@
         """
         file_data = action_data.get("file_data", {})
 
-        file_name = file_data.get('name')
-        file_size = file_data.get('size')
+        file_name = file_data.get("name")
+        file_size = file_data.get("size")
 
         if file_name:
             file_name_msg = 'wants to send you the file "{file_name}"'.format(
                 file_name=file_name
             )
         else:
-            file_name_msg = 'wants to send you an unnamed file'
+            file_name_msg = "wants to send you an unnamed file"
 
         if file_size is not None:
             file_size_msg = "which has a size of {file_size_human}".format(
@@ -208,7 +206,7 @@
         else:
             file_size_msg = "which has an unknown size"
 
-        file_description = file_data.get('desc')
+        file_description = file_data.get("desc")
         if file_description:
             description_msg = " Description: {}.".format(file_description)
         else:
@@ -221,14 +219,14 @@
         else:
             peer_name = f"{peer_name} ({peer_jid})"
 
-        return (
-            _("{peer_name} {file_name_msg} {file_size_msg}.{description_msg} "
-            "Do you accept?").format(
-                peer_name=peer_name,
-                file_name_msg=file_name_msg,
-                file_size_msg=file_size_msg,
-                description_msg=description_msg
-            )
+        return _(
+            "{peer_name} {file_name_msg} {file_size_msg}.{description_msg} "
+            "Do you accept?"
+        ).format(
+            peer_name=peer_name,
+            file_name_msg=file_name_msg,
+            file_size_msg=file_size_msg,
+            description_msg=description_msg,
         )
 
     def _on_dc_message_data(self, fd, data_channel, glib_data) -> None: