+def add_all_to_list(domains: list, source: str, splitter: str) -> None:
+ logger.debug("domains()=%d,source='%s',splitter='%s' - CALLED!")
+ if not isinstance(domains, list):
+ raise TypeError(f"Parameter domains[]='{type(domains)}' is not type 'list'")
+ elif not isinstance(source, str):
+ raise TypeError(f"Parameter source[]='{type(source)}' is not type 'list'")
+ elif source == "":
+ raise ValueError("Parameter 'source' is empty")
+ elif not isinstance(splitter, str):
+ raise TypeError(f"Parameter splitter[]='{type(splitter)}' is not type 'list'")
+ elif splitter == "":
+ raise ValueError("Parameter 'splitter' is empty")
+
+ for domain in source.split(splitter):
+ logger.debug("domain='%s' - LOOP!", domain)
+ domain = domain.strip()
+ if not domain_helper.is_wanted(domain):
+ logger.warning("domain='%s' is not wanted - SKIPPED!", domain)
+ continue
+
+ logger.debug("Appending domain='%s' ...", domain)
+ domains.append(domain)
+
+ logger.debug("EXIT!")
+