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

Reformatted code base using black.
author Goffi <goffi@goffi.org>
date Wed, 19 Jun 2024 18:44:57 +0200
parents 4b842c1fb686
children
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0231.py	Tue Jun 18 12:06:45 2024 +0200
+++ b/libervia/backend/plugins/plugin_xep_0231.py	Wed Jun 19 18:44:57 2024 +0200
@@ -185,12 +185,13 @@
             client.send(error_elt)
             return
 
-        with open(metadata["path"], 'rb') as f:
+        with open(metadata["path"], "rb") as f:
             data = f.read()
 
         result_elt = xmlstream.toResponse(iq_elt, "result")
         data_elt = result_elt.addElement(
-            (NS_BOB, "data"), content=base64.b64encode(data).decode())
+            (NS_BOB, "data"), content=base64.b64encode(data).decode()
+        )
         data_elt["cid"] = cid
         data_elt["type"] = metadata["mime_type"]
         data_elt["max-age"] = str(int(max(0, metadata["eol"] - time.time())))
@@ -240,7 +241,9 @@
     def connectionInitialized(self):
         if self.parent.is_component:
             self.xmlstream.addObserver(
-                IQ_BOB_REQUEST, self.plugin_parent.on_component_request, client=self.parent
+                IQ_BOB_REQUEST,
+                self.plugin_parent.on_component_request,
+                client=self.parent,
             )
 
     def getDiscoInfo(self, requestor, target, nodeIdentifier=""):