"pub-relay"
]
+# In-function cache
+_cache = {
+ # Cache for function alias()
+ "alias" : {},
+}
+
def alias(software: str) -> str:
logger.debug("software='%s'- CALLED!", software)
raise ValueError(f"software[]='{type(software)}' is not type 'str'")
elif software == "":
raise ValueError("Parameter 'software' is empty")
+ elif software in _cache["alias"]:
+ logger.debug("Returning cached value='%s' for function 'alias' - EXIT!", _cache["alias"][software])
+ return _cache["alias"][software]
+
+ key = software
logger.debug("software='%s'- BEFORE!", software)
software = tidyup.domain(software)
logger.debug("software='%s' is being cleaned up further ...")
software = software.rstrip("!").strip()
+ # Set cache
+ _cache["alias"][key] = software
+
logger.debug("software[%s]='%s' - EXIT!", type(software), software)
return software