From 7e165e4a39217d7bb0ffae6ce7f6f2d696c719de Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 9 Jun 2023 06:46:23 +0200 Subject: [PATCH] Continued: - fixed more "Undefined variable" --- fba/cache.py | 2 +- fba/commands.py | 2 +- fba/fba.py | 2 +- fba/network.py | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fba/cache.py b/fba/cache.py index 71ca822..6fac6ce 100644 --- a/fba/cache.py +++ b/fba/cache.py @@ -36,7 +36,7 @@ def set_all(key: str, rows: list, value: any): if isinstance(sub, tuple): _cache[key][sub[0]] = value else: - print(f"WARNING: Unsupported type row[]='{type(row)}'") + print(f"WARNING: Unsupported type sub[]='{type(sub)}'") # DEBUG: print("DEBUG: EXIT!") diff --git a/fba/commands.py b/fba/commands.py index ce06879..089dd2e 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -355,7 +355,7 @@ def fetch_fba_rss(args: argparse.Namespace): domains.append(domain) except BaseException as exception: - print(f"ERROR: Cannot fetch feed='{feed}',exception[{type(exception)}]:'{str(exception)}'") + print(f"ERROR: Cannot fetch args.feed='{args.feed}',exception[{type(exception)}]:'{str(exception)}'") sys.exit(255) # DEBUG: print(f"DEBUG: domains()={len(domains)}") diff --git a/fba/fba.py b/fba/fba.py index 59a3e83..1062d17 100644 --- a/fba/fba.py +++ b/fba/fba.py @@ -627,7 +627,7 @@ def determine_software(domain: str, path: str = None) -> str: software = "misskey" elif software.find("/") > 0: print("WARNING: Spliting of slash:", software) - software = tidup_domain(software.split("/")[-1]); + software = tidyup_domain(software.split("/")[-1]); elif software.find("|") > 0: print("WARNING: Spliting of pipe:", software) software = tidyup_domain(software.split("|")[0]); diff --git a/fba/network.py b/fba/network.py index df883c9..78bb304 100644 --- a/fba/network.py +++ b/fba/network.py @@ -68,8 +68,8 @@ def post_json_api(domain: str, path: str, parameter: str, extra_headers: dict = # DEBUG: print(f"DEBUG: Returning data({len(data)})=[]:{type(data)}") return data -def send_bot_post(instance: str, blocklist: dict): - # DEBUG: print(f"DEBUG: instance={instance},blocklist()={len(blocklist)} - CALLED!") +def send_bot_post(domain: str, blocklist: dict): + # DEBUG: print(f"DEBUG: domain={domain},blocklist()={len(blocklist)} - CALLED!") if not isinstance(domain, str): raise ValueError(f"Parameter domain[]='{type(domain)}' is not 'str'") elif domain == "": @@ -77,7 +77,7 @@ def send_bot_post(instance: str, blocklist: dict): elif not isinstance(blocklist, dict): raise ValueError(f"Parameter blocklist[]='{type(blocklist)}' is not 'dict'") - message = f"{instance} has blocked the following instances:\n\n" + message = f"{domain} has blocked the following instances:\n\n" truncated = False if len(blocklist) > 20: @@ -152,8 +152,8 @@ def fetch_friendica_blocks(domain: str) -> dict: for line in rows: # DEBUG: print(f"DEBUG: line='{line}'") blocked.append({ - "domain": tidyup_domain(line.find_all("td")[0].text), - "reason": tidyup_reason(line.find_all("td")[1].text) + "domain": fba.tidyup_domain(line.find_all("td")[0].text), + "reason": fba.tidyup_reason(line.find_all("td")[1].text) }) # DEBUG: print("DEBUG: Next!") -- 2.39.5