From 9b902bda359b5e09d90fea9eaf5a2019ae4a4265 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 7 Jun 2023 00:26:21 +0200 Subject: [PATCH] Continued: - commented out debug lines - added commented-out lines, too ;-) - tidyup software name --- fba/fba.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fba/fba.py b/fba/fba.py index da9c693..263782f 100644 --- a/fba/fba.py +++ b/fba/fba.py @@ -399,13 +399,13 @@ def get_peers(domain: str, software: str) -> list: raise ValueError(f"software[]={type(software)} is not 'str'") if software == "misskey": - print(f"DEBUG: Invoking misskey.get_peers({domain}) ...") + # DEBUG: print(f"DEBUG: Invoking misskey.get_peers({domain}) ...") return misskey.get_peers(domain) elif software == "lemmy": - print(f"DEBUG: Invoking lemmy.get_peers({domain}) ...") + # DEBUG: print(f"DEBUG: Invoking lemmy.get_peers({domain}) ...") return lemmy.get_peers(domain) elif software == "peertube": - print(f"DEBUG: Invoking peertube.get_peers({domain}) ...") + # DEBUG: print(f"DEBUG: Invoking peertube.get_peers({domain}) ...") return peertube.get_peers(domain) # DEBUG: print(f"DEBUG: Fetching get_peers_url='{get_peers_url}' from '{domain}',software='{software}' ...") @@ -453,6 +453,7 @@ def get_peers(domain: str, software: str) -> list: return peers def post_json_api(domain: str, path: str, parameter: str, extra_headers: dict = {}) -> dict: + # DEBUG: print(f"DEBUG: domain='{domain}',path='{path}',parameter='{parameter}',extra_headers()={len(extra_headers)} - CALLED!") if type(domain) != str: raise ValueError(f"Parameter domain[]={type(domain)} is not 'str'") elif domain == "": @@ -712,7 +713,7 @@ def determine_software(domain: str, path: str = None) -> str: software = "misskey" elif software.find("/") > 0: print("WARNING: Spliting of slash:", software) - software = software.split("/")[-1]; + software = tidup_domain(software.split("/")[-1]); elif software.find("|") > 0: print("WARNING: Spliting of pipe:", software) software = tidyup_domain(software.split("|")[0]); -- 2.39.5