From: Roland Häder Date: Sun, 18 Jun 2023 01:35:46 +0000 (+0200) Subject: Continue: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6cf632ccff03612602ee479782cb486e48c82108;p=fba.git Continue: - continue checking on software type after it was discovered by generator/site_name - maybe it needs aliasing? - also add 'slipfox calckey' as an alias for 'misskey' - don't tidy-up None values --- diff --git a/fba/federation.py b/fba/federation.py index 55a0b21..9ccbc60 100644 --- a/fba/federation.py +++ b/fba/federation.py @@ -437,20 +437,25 @@ def determine_software(domain: str, path: str = None) -> str: elif "software" not in data or "name" not in data["software"]: # DEBUG: print(f"DEBUG: JSON response from domain='{domain}' does not include [software][name], fetching / ...") software = fetch_generator_from_path(domain) + # DEBUG: print(f"DEBUG: Generator for domain='{domain}' is: '{software}'") + elif "software" in data and "name" in data["software"]: + # DEBUG: print("DEBUG: Found data[software][name] in JSON response") + software = data["software"]["name"] - # DEBUG: print(f"DEBUG: Generator for domain='{domain}' is: {software}, EXIT!") - return software - - software = tidyup.domain(data["software"]["name"]) + if software is None: + # DEBUG: print("DEBUG: Returning None - EXIT!") + return None + sofware = tidyup.domain(software) # DEBUG: print("DEBUG: sofware after tidyup.domain():", software) + if software in ["akkoma", "rebased"]: # DEBUG: print("DEBUG: Setting pleroma:", domain, software) software = "pleroma" elif software in ["hometown", "ecko"]: # DEBUG: print("DEBUG: Setting mastodon:", domain, software) software = "mastodon" - elif software in ["calckey", "groundpolis", "foundkey", "cherrypick", "meisskey"]: + elif software in ["slipfox calckey", "calckey", "groundpolis", "foundkey", "cherrypick", "meisskey"]: # DEBUG: print("DEBUG: Setting misskey:", domain, software) software = "misskey" elif software == "runtube.re":