I'd like to have the application handle the stop event in such a way that it removes whatever current effect is in place, and executes some 'cleanup' code. Similarly to the previously mentioned issue, this could be handled via the stop method call within effects.
This, unlike the aforementioned issue. could actually be handled with a try/except/finally block, with the cleanup being run when an exception is thrown. Likely being placed around the await self.current_effect.start(self.pm, self.module) method call within ChaosHandler.
We would likely have to store some kind of class variable within effects to flag if the effect has been stopped, however. This way the user wouldn't be able to press Stop, then exit the application, thereby causing the cleanup to execute twice.
This potentially shares some overlap with #4
I'd like to have the application handle the stop event in such a way that it removes whatever current effect is in place, and executes some 'cleanup' code. Similarly to the previously mentioned issue, this could be handled via the
stop
method call within effects.This, unlike the aforementioned issue. could actually be handled with a try/except/finally block, with the cleanup being run when an exception is thrown. Likely being placed around the
await self.current_effect.start(self.pm, self.module)
method call within ChaosHandler.We would likely have to store some kind of class variable within effects to flag if the effect has been stopped, however. This way the user wouldn't be able to press Stop, then exit the application, thereby causing the cleanup to execute twice.