]> git.mxchange.org Git - fba.git/commitdiff
Fixed:
authorRoland Häder <roland@mxchange.org>
Tue, 20 Jun 2023 12:58:26 +0000 (14:58 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 20 Jun 2023 12:58:26 +0000 (14:58 +0200)
- `if not "foo" in bar` is wrong, use `if "foo" not in bar` instead

fba/commands.py
fba/federation.py
fba/helpers/version.py
fba/networks/misskey.py

index 4daf53465b7d4fba8c1dd69ec3263335fa0bdc4e..fb83824a235f40789c947b185c28d0b983b9cd82 100644 (file)
@@ -89,7 +89,7 @@ def fetch_bkali(args: argparse.Namespace) -> int:
 
         for entry in rows["data"]["nodeinfo"]:
             # DEBUG: print(f"DEBUG: entry['{type(entry)}']='{entry}'")
-            if not "domain" in entry:
+            if "domain" not in entry:
                 print(f"WARNING: entry()={len(entry)} does not contain 'domain' - SKIPPED!")
                 continue
             elif not validators.domain(entry["domain"]):
index 6d3247f58b6e1a58af893048d9d444055b5408bf..5e01148b6ad9b3b9bb58a69a6e76362c26050541 100644 (file)
@@ -360,7 +360,7 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict:
                      )
 
                     # DEBUG: print("DEBUG: href,data[]:", link["href"], type(data))
-                    if not "error_message" in data and "json" in data:
+                    if "error_message" not in data and "json" in data:
                         # DEBUG: print("DEBUG: Found JSON nodeinfo():", len(data))
                         instances.set_detection_mode(domain, "AUTO_DISCOVERY")
                         instances.set_nodeinfo_url(domain, link["href"])
index 15b05b366ba15f6ad0b53de57893e14130dbaf60..8cdb3620abb2cd76777b2e42e49272957567c289 100644 (file)
@@ -29,7 +29,7 @@ patterns = [
 
 def remove(software: str) -> str:
     # DEBUG: print(f"DEBUG: software='{software}' - CALLED!")
-    if not "." in software and " " not in software:
+    if "." not in software and " " not in software:
         print(f"WARNING: software='{software}' does not contain a version number.")
         return software
 
index 3fd1c5a683207f836aa4b92870d299702447dcf9..152d97107182d17c3774b320d4df79e220f1a3a5 100644 (file)
@@ -96,7 +96,7 @@ def fetch_peers(domain: str) -> list:
         # DEBUG: print(f"DEBUG: rows({len(rows)})[]='{type(rows)}'")
         for row in rows:
             # DEBUG: print(f"DEBUG: row()={len(row)}")
-            if not "host" in row:
+            if "host" not in row:
                 print(f"WARNING: row()={len(row)} does not contain key 'host': {row},domain='{domain}'")
                 continue
             elif not isinstance(row["host"], str):