From 7f631254db0e2bc22255836685be45ba03566513 Mon Sep 17 00:00:00 2001
From: jkerdreux-imt <jerome.kerdreux@imt-atlantique.fr>
Date: Tue, 26 Nov 2024 14:35:00 +0100
Subject: [PATCH] Format

---
 libs/lib/xaal/lib/cbor.py | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/libs/lib/xaal/lib/cbor.py b/libs/lib/xaal/lib/cbor.py
index cf2d622d..991c3cba 100644
--- a/libs/lib/xaal/lib/cbor.py
+++ b/libs/lib/xaal/lib/cbor.py
@@ -16,25 +16,30 @@ def tag_hook(decoder, tag, shareable_index=None):
         return bindings.URL(tag.value)
     return tag
 
+
 def default_encoder(encoder, value):
-    if isinstance(value,bindings.UUID):
+    if isinstance(value, bindings.UUID):
         encoder.encode(CBORTag(37, value.bytes))
 
-    if isinstance(value,bindings.URL):
+    if isinstance(value, bindings.URL):
         encoder.encode(CBORTag(32, value.bytes))
 
+
 def dumps(obj, **kwargs):
-    return cbor2.dumps(obj,default=default_encoder,**kwargs)
+    return cbor2.dumps(obj, default=default_encoder, **kwargs)
+
 
 def loads(payload, **kwargs):
-    #return cbor2.loads(payload,tag_hook=tag_hook,**kwargs)
-    return _loads(payload,tag_hook=tag_hook,**kwargs)
+    # return cbor2.loads(payload,tag_hook=tag_hook,**kwargs)
+    return _loads(payload, tag_hook=tag_hook, **kwargs)
+
 
 def _loads(s, **kwargs):
     with BytesIO(s) as fp:
         return CBORDecoder(fp, **kwargs).decode()
 
-#class CustomDecoder(CBORDecoder):pass
+
+# class CustomDecoder(CBORDecoder):pass
 
 
 def cleanup(obj):
@@ -45,14 +50,14 @@ def cleanup(obj):
     Warning: This operate in-place changes.
     Warning: This won't work for tags in dict keys.
     """
-    if isinstance(obj,list):
-        for i in range(0,len(obj)):
+    if isinstance(obj, list):
+        for i in range(0, len(obj)):
             obj[i] = cleanup(obj[i])
         return obj
 
-    if isinstance(obj,dict):
+    if isinstance(obj, dict):
         for k in obj.keys():
-            obj.update({k:cleanup(obj[k])})
+            obj.update({k: cleanup(obj[k])})
         return obj
 
     if type(obj) in bindings.classes:
-- 
GitLab