]> git.mxchange.org Git - fba.git/blobdiff - fba/federation/pleroma.py
WIP:
[fba.git] / fba / federation / pleroma.py
index 764209c918eaddbd93ea37818f4a4810969f63e9..5e3bbf1c9ed6fa46b6f76d0143a5fc7caf0b7a0c 100644 (file)
@@ -40,22 +40,22 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str):
     try:
         # Blocks
         blockdict = list()
-        json = fba.fetch_nodeinfo(domain, nodeinfo_url)
+        rows = fba.fetch_nodeinfo(domain, nodeinfo_url)
 
-        if json is None:
+        if rows is None:
             print("WARNING: Could not fetch nodeinfo from domain:", domain)
             return
-        elif not "metadata" in json:
-            print(f"WARNING: json()={len(json)} does not have key 'metadata', domain='{domain}'")
+        elif not "metadata" in rows:
+            print(f"WARNING: rows()={len(rows)} does not have key 'metadata', domain='{domain}'")
             return
-        elif not "federation" in json["metadata"]:
-            print(f"WARNING: json()={len(json['metadata'])} does not have key 'federation', domain='{domain}'")
+        elif not "federation" in rows["metadata"]:
+            print(f"WARNING: rows()={len(rows['metadata'])} does not have key 'federation', domain='{domain}'")
             return
 
         # DEBUG: print("DEBUG: Updating nodeinfo:", domain)
         instances.update_last_nodeinfo(domain)
 
-        federation = json["metadata"]["federation"]
+        federation = rows["metadata"]["federation"]
 
         if "enabled" in federation:
             # DEBUG: print("DEBUG: Instance has no block list to analyze:", domain)
@@ -187,7 +187,7 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str):
                     # DEBUG: print("DEBUG: Updating block reason:", domain, blocked, reason["reason"])
                     blocks.update_reason(reason["reason"], domain, blocked, block_level)
 
-                    # DEBUG: print(f"DEBUG: blockdict()={count(blockdict)")
+                    # DEBUG: print(f"DEBUG: blockdict()={len(blockdict)}")
                     for entry in blockdict:
                         if entry["blocked"] == blocked:
                             # DEBUG: print("DEBUG: Updating entry reason:", blocked)