From: Roland Häder Date: Sun, 20 Apr 2025 22:58:54 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=76873fe757126a3d5420b6d779a6b03ceee0f2e9;p=fba.git Continued: - renamed item(s) to node(s) to clarify the purpose, not generic "item" --- diff --git a/fba/commands.py b/fba/commands.py index 23a83bf..9730c2a 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -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)