]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 10 Jan 2025 08:19:55 +0000 (09:19 +0100)
committerRoland Häder <roland@mxchange.org>
Fri, 10 Jan 2025 08:20:15 +0000 (09:20 +0100)
- software.remove_extras() is now cached

fba/helpers/software.py
fba/helpers/tidyup.py

index d6577e9f569c6c340545bc6d2e9eb32352d0dc50..0c26d41b6a43455011909edfdde51f7ee064810f 100644 (file)
@@ -298,6 +298,7 @@ def is_relay(software: str) -> bool:
     logger.debug("found='%s' - EXIT!", found)
     return found
 
+@lru_cache
 def remove_extras(software: str):
     logger.debug("software[%s]='%s' - CALLED!", type(software), software)
     if not isinstance(software, str):
index a249926e95502e943aa7e979948951d489c7b3f3..be7503d85013ab50f0df7bb03d40815f5c25c3de 100644 (file)
@@ -38,7 +38,7 @@ def domain(string: str) -> str:
     if not isinstance(string, str):
         raise ValueError(f"Parameter string[]='{type(string)}' is not of type 'str'")
     elif string == "":
-        raise ValueError("Parameter string is empty")
+        raise ValueError("Parameter 'string' is empty")
 
     # All lower-case and strip spaces out + last dot
     string = string.lower().strip().rstrip(".").replace("..", ".")