From: Roland Häder Date: Tue, 20 Jun 2023 12:58:26 +0000 (+0200) Subject: Fixed: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c1d169b84e21c0f20305823cc4566bd7973d8f71;p=fba.git Fixed: - `if not "foo" in bar` is wrong, use `if "foo" not in bar` instead --- diff --git a/fba/commands.py b/fba/commands.py index 4daf534..fb83824 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -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"]): diff --git a/fba/federation.py b/fba/federation.py index 6d3247f..5e01148 100644 --- a/fba/federation.py +++ b/fba/federation.py @@ -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"]) diff --git a/fba/helpers/version.py b/fba/helpers/version.py index 15b05b3..8cdb362 100644 --- a/fba/helpers/version.py +++ b/fba/helpers/version.py @@ -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 diff --git a/fba/networks/misskey.py b/fba/networks/misskey.py index 3fd1c5a..152d971 100644 --- a/fba/networks/misskey.py +++ b/fba/networks/misskey.py @@ -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):