Skip multiprocessing if no callback actions requested; Add sound param; Fix signal handling#26
Conversation
| self._callback_executor_thread: CallbackExecutorThread | None = None | ||
| self._callback_listener_process: NotificationProcess | None = None | ||
| # Specify that once we stop our application, self.cleanup should run | ||
| atexit.register(self.cleanup) |
There was a problem hiding this comment.
@Jorricks why do you need both atexit() and custom SIGINT handling that do the exact same thing (call self.cleanup())? Seems like just atexit() should be sufficient to accomplish what you are going for?
There was a problem hiding this comment.
I honestly do not recall.
I think we can indeed remove the catch_keyboard_interrupt but let's save that for another MR.
|
It turns out that because the |
|
First of all, sorry for being so slow to respond. |
Changes:
sys.exit()is just the return code for the shell; it does not re-raise theSIGINTto callsys.exit(signal.SIGINT). Now it properly re-raises the trapped signal.soundparameter as per the other PR Add sound param #25In order to implement (1) I had to move the
MacOSNotificationclass outside of thecreate_notification()method so it would not be redeclared every timecreate_notification()is called - see my comment.Re: (2) I'm still not really convinced that trapping
SIGINTin a package is the best idea and am kind of concerned about other unforeseen side effects but at least re-raising it seems to work as the user might expect.Feel free to cherry pick and/or request changes.