in dusty/reporters/performer.py [0:0]
def prepare(self):
""" Prepare for action """
log.debug("Preparing")
config = self.context.config["reporters"]
config_items = [
item for item in list(config) if not isinstance(config[item], bool) or config[item]
]
disabled_items = [
item for item in list(config) if isinstance(config[item], bool) and not config[item]
]
# Schedule reporters
try:
all_reporters = dependency.resolve_name_order(
config_items + [
item for item in constants.DEFAULT_REPORTERS if item not in disabled_items
], "dusty.reporters.{}.reporter", "Reporter"
)
except:
all_reporters = [
item for item in constants.DEFAULT_REPORTERS if item not in disabled_items
] + config_items
for reporter_name in all_reporters:
try:
self.schedule_reporter(reporter_name, dict())
except:
log.exception("Failed to prepare reporter %s", reporter_name)
error = Error(
tool=reporter_name,
error=f"Failed to prepare reporter {reporter_name}",
details=f"```\n{traceback.format_exc()}\n```"
)
self.context.errors.append(error)
# Resolve depencies once again
dependency.resolve_depencies(self.context.reporters)