def evtop(app=None):
 app = app_or_default(app)
 state = app.events.State()
 display = CursesMonitor(state, app)
 display.init_screen()
 refresher = DisplayThread(display)
 refresher.start()
 try:
  capture_events(app, state, display)
 except Exception:
  refresher.shutdown = True
  refresher.join()
  display.resetscreen()
  raise
 except (KeyboardInterrupt, SystemExit):
  refresher.shutdown = True
  refresher.join()
  display.resetscreen()

def evtop ( app = None ) : app = app_or_default ( app ) state = app . events . State ( ) display = CursesMonitor ( state , app ) display . init_screen ( ) refresher = DisplayThread ( display ) refresher . start ( ) try : capture_events ( app , state , display ) except Exception : refresher . shutdown = True refresher . join ( ) display . resetscreen ( ) raise except ( KeyboardInterrupt , SystemExit ) : refresher . shutdown = True refresher . join ( ) display . resetscreen ( )
start curses monitor .