add RT signal handler

This commit is contained in:
piotr
2022-12-08 02:40:20 +01:00
parent 19ad8b2938
commit 5047cbe0ee

View File

@@ -93,8 +93,10 @@ def signal_handler(sig, frame):
Gtk.main_quit()
elif sig == sig_dwl:
refresh_dwl()
elif signal.SIGRTMIN > sig <= signal.SIGRTMAX:
print("{} RTC signal received".format(sig))
def rt_sig_handler(sig, frame):
print("{} RT signal received".format(sig))
def restart():
@@ -352,6 +354,12 @@ def main():
except Exception as exc:
eprint("{} subscription error: {}".format(sig, exc))
for sig in range(signal.SIGRTMIN, signal.SIGRTMAX):
try:
signal.signal(sig, rt_sig_handler)
except Exception as exc:
eprint("{} subscription error: {}".format(sig, exc))
check_commands()
print("Dependencies check:", common.commands)