diff options
author | Micah Nordland <micah@rehack.me> | 2016-01-26 12:28:03 -0500 |
---|---|---|
committer | Micah Nordland <micah@rehack.me> | 2016-01-26 12:28:03 -0500 |
commit | b03a48b298fc49d68e14dc1abd35b8bacf3e83e9 (patch) | |
tree | 45ab90ab54bb625d46ff650f116d3bc590841ca6 /alot/ui.py | |
parent | 9f8d4baf9b9b991abdc9be8c6831f1c641099ba5 (diff) |
refresh current buffer on SIGUSR1
Diffstat (limited to 'alot/ui.py')
-rw-r--r-- | alot/ui.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -3,6 +3,7 @@ # For further details see the COPYING file import urwid import logging +import signal from twisted.internet import reactor, defer from settings import settings @@ -68,6 +69,8 @@ class UI(object): mainframe = urwid.Frame(urwid.SolidFill()) self.root_widget = urwid.AttrMap(mainframe, global_att) + signal.signal(signal.SIGUSR1, self.handle_signal) + # set up main loop self.mainloop = urwid.MainLoop(self.root_widget, handle_mouse=False, @@ -637,3 +640,7 @@ class UI(object): d.addCallback(call_apply) d.addCallback(call_posthook) return d + def handle_signal(self, signum, frame): + self.current_buffer.rebuild() + self.update() + |