INNER CODE UNIT · Python
get_loobins
infosecB/LOOBins · src/pyloobins/util.py:33
def get_loobins(path: str = "") -> list[LOOBin]:
"""Returns a list of LOOBin objects"""
loobins = []
if path:
yml_files = list(pathlib.Path(path).glob("**/*.yml"))
else:
yml_files = _discover_loobin_files()
for yml_file in yml_files:
with open(yml_file, "r", encoding="utf-8") as stream:
try:
yml_content = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(f"Error parsing {yml_file}: {exc}")
continue
try:
loobins.append(LOOBin(**yml_content))
except Exception as exc: