From: Roland Häder Date: Fri, 9 Jun 2023 04:46:23 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7e165e4a39217d7bb0ffae6ce7f6f2d696c719de;p=fba.git Continued: - fixed more "Undefined variable" --- 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!")