I’d like to be able to defuse a firework from within itself. In other words, I’d like to have a firetask that looks something like this:
from fireworks import FiretaskBase, explicit_serialize, FWAction
@explicit_serialize
class TestFireTask(FiretaskBase):
def run_task(self, fw_spec):
defuse = fw_spec.get("defuse ", False)
if defuse:
# CODE TO DEFUSE THE FIREWORK THAT THIS TASK IS A PART OF
else:
return FWAction()
Is there a way to accomplish this?