Allows to implement helper classes in pba files

This commit is contained in:
VakarisZ 2019-05-16 12:57:15 +03:00
parent 4a8bd01a62
commit 002447e749
1 changed files with 2 additions and 1 deletions

View File

@ -40,7 +40,8 @@ class PostBreach(object):
# Import module from that file
module = importlib.import_module(PATH_TO_ACTIONS + pba_file)
# Get all classes in a module
pba_classes = [m[1] for m in inspect.getmembers(module, inspect.isclass) if m[1].__module__ == module.__name__]
pba_classes = [m[1] for m in inspect.getmembers(module, inspect.isclass)
if ((m[1].__module__ == module.__name__) and getattr(m[1], "get_pba", False))]
# Get post breach action object from class
for pba_class in pba_classes:
pba = pba_class.get_pba()