]> git.mxchange.org Git - fba.git/commitdiff
Fixed:
authorRoland Häder <roland@mxchange.org>
Mon, 10 Jul 2023 23:04:13 +0000 (01:04 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 10 Jul 2023 23:04:24 +0000 (01:04 +0200)
- "TypeError: 'sqlite3.Row' object does not support item assignment"

fba/commands.py

index 6c0657993155212946b1c1e9c1f12a63c64c7ffe..106964dc8809bd6d464cbc8b4155829e8c7a9a0c 100644 (file)
@@ -148,21 +148,21 @@ def fetch_pixelfed_api(args: argparse.Namespace) -> int:
                 continue
 
             logger.debug("row[domain]='%s' - BEFORE!", row["domain"])
-            row["domain"] = row["domain"].encode("idna").decode("utf-8")
-            logger.debug("row[domain]='%s' - AFTER!", row["domain"])
+            domain = row["domain"].encode("idna").decode("utf-8")
+            logger.debug("domain='%s' - AFTER!", domain)
 
-            if not utils.is_domain_wanted(row["domain"]):
-                logger.warning("row[domain]='%s' is not wanted - SKIPPED!", row["domain"])
+            if not utils.is_domain_wanted(domain):
+                logger.warning("domain='%s' is not wanted - SKIPPED!", domain)
                 continue
-            elif instances.is_registered(row["domain"]):
-                logger.debug("row[domain]='%s' is already registered - SKIPPED!", row["domain"])
+            elif instances.is_registered(domain):
+                logger.debug("domain='%s' is already registered - SKIPPED!", domain)
                 continue
-            elif instances.is_recent(row["domain"]):
-                logger.debug("row[domain]='%s' has been recently crawled - SKIPPED!", row["domain"])
+            elif instances.is_recent(domain):
+                logger.debug("domain='%s' has been recently crawled - SKIPPED!", domain)
                 continue
 
-            logger.debug("Fetching instances from row[domain]='%s' ...", row["domain"])
-            federation.fetch_instances(row["domain"], None, None, inspect.currentframe().f_code.co_name)
+            logger.debug("Fetching instances from domain='%s' ...", domain)
+            federation.fetch_instances(domain, None, None, inspect.currentframe().f_code.co_name)
 
     except network.exceptions as exception:
         logger.warning("Cannot fetch graphql,exception[%s]:'%s' - EXIT!", type(exception), str(exception))
@@ -920,19 +920,19 @@ def fetch_instances(args: argparse.Namespace) -> int:
             continue
 
         logger.debug("row[domain]='%s' - BEFORE!", row["domain"])
-        row["domain"] = row["domain"].encode("idna").decode("utf-8")
-        logger.debug("row[domain]='%s' - AFTER!", row["domain"])
+        domain = row["domain"].encode("idna").decode("utf-8")
+        logger.debug("domain='%s' - AFTER!", domain)
 
-        if not utils.is_domain_wanted(row["domain"]):
-            logger.warning("Domain row[domain]='%s' is not wanted - SKIPPED!", row["domain"])
+        if not utils.is_domain_wanted(domain):
+            logger.warning("Domain domain='%s' is not wanted - SKIPPED!", domain)
             continue
 
         try:
-            logger.info("Fetching instances for domain='%s',origin='%s',software='%s',nodeinfo_url='%s'", row["domain"], row["origin"], row["software"], row["nodeinfo_url"])
-            federation.fetch_instances(row["domain"], row["origin"], row["software"], inspect.currentframe().f_code.co_name, row["nodeinfo_url"])
+            logger.info("Fetching instances for domain='%s',origin='%s',software='%s',nodeinfo_url='%s'", domain, row["origin"], row["software"], row["nodeinfo_url"])
+            federation.fetch_instances(domain, row["origin"], row["software"], inspect.currentframe().f_code.co_name, row["nodeinfo_url"])
         except network.exceptions as exception:
-            logger.warning("Exception '%s' during fetching instances (fetch_instances) from row[domain]='%s'", type(exception), row["domain"])
-            instances.set_last_error(row["domain"], exception)
+            logger.warning("Exception '%s' during fetching instances (fetch_instances) from domain='%s'", type(exception), domain)
+            instances.set_last_error(domain, exception)
 
     logger.debug("Success - EXIT!")
     return 0