]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 20 Apr 2025 22:58:54 +0000 (00:58 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 20 Apr 2025 22:58:54 +0000 (00:58 +0200)
- renamed item(s) to node(s) to clarify the purpose, not generic "item"

fba/commands.py

index 23a83bfe261e83cc31ec0e379ac1a5730f3a7e9f..9730c2acfaf9ac46d367ed55eaba1a3968334602 100644 (file)
@@ -557,7 +557,7 @@ def fetch_observer(args: argparse.Namespace) -> int:
             logger.debug("args.software='%s' does not match software='%s' - SKIPPED!", args.software, software)
             continue
 
-        items = []
+        nodes = []
         try:
             logger.debug("Fetching table data for software='%s' ...", software)
             raw = network.post_json_api(
@@ -582,26 +582,26 @@ def fetch_observer(args: argparse.Namespace) -> int:
                 logger.warning("Cannot find key 'nodes' in raw[json][data]()=%d", len(raw["json"]["data"]))
                 continue
 
-            items = raw["json"]["data"]["nodes"]
-            logger.debug("items()=%d", len(items))
+            nodes = raw["json"]["data"]["nodes"]
+            logger.debug("nodes()=%d", len(nodes))
 
         except network.exceptions as exception:
             logger.warning("Cannot fetch software='%s' from source_domain='%s': '%s'", software, source_domain, type(exception))
             continue
 
-        logger.info("Checking %d items,software='%s' ...", len(items), software)
-        for item in items:
-            logger.debug("item[]='%s'", type(item))
-            if "domain" not in item:
-                logger.debug("item()=%d has not element 'domain'", len(item))
+        logger.info("Checking %d nodes,software='%s' ...", len(nodes), software)
+        for node in nodes:
+            logger.debug("node[]='%s'", type(node))
+            if "domain" not in node:
+                logger.debug("node()=%d has not element 'domain'", len(node))
                 continue
 
-            logger.debug("item[domain]='%s' - BEFORE!", item["domain"])
-            domain = tidyup.domain(item["domain"]) if item["domain"] not in [None, ""] else None
+            logger.debug("node[domain]='%s' - BEFORE!", node["domain"])
+            domain = tidyup.domain(node["domain"]) if node["domain"] not in [None, ""] else None
             logger.debug("domain='%s' - AFTER!", domain)
 
             if domain in [None, ""]:
-                logger.debug("domain[%s]='%s' is empty after tidyup.domain(): item[domain]='%s' - SKIPPED!", type(domain), domain, item["domain"])
+                logger.debug("domain[%s]='%s' is empty after tidyup.domain(): node[domain]='%s' - SKIPPED!", type(domain), domain, node["domain"])
                 continue
             elif not domain_helper.is_wanted(domain):
                 logger.debug("domain='%s' is not wanted - SKIPPED!", domain)