Skip to content
Snippets Groups Projects
Commit 17b35d20 authored by Johann Jacobsohn's avatar Johann Jacobsohn
Browse files

escape program on esc

parent 52d1038d
No related branches found
No related tags found
No related merge requests found
......@@ -275,10 +275,15 @@ class Papersurfer:
urwid.connect_signal(ask, 'change', self.onchange)
self.main = pile
self.mainloop = urwid.MainLoop(self._over, self._palette)
self.mainloop = urwid.MainLoop(self._over, self._palette,
unhandled_input=self.h_input )
self.mainloop.set_alarm_in(.1, self.load_list)
self.mainloop.run()
def h_input(self, key):
if key == "esc":
raise urwid.ExitMainLoop()
def load_list(self, _loop, _data):
body = [self.list_item(paper) for paper in self.mtm.retrieve()]
self.listcontent.clear()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment