예제 #1
0
    def handle_events(self):
        errors = 0

        while True:
            try:
                # Get the next event, or block until the next event is received.
                event = self.display.next_event()
                self.handle_event(event)
            except Xlib.error.ConnectionClosedError:
                log_error('Display connection closed by server.')
                raise KeyboardInterrupt
            except (KeyboardInterrupt, SystemExit):
                raise
            except:
                errors += 1
                if errors > MAX_EXCEPTIONS:
                    raise
                traceback.print_exc()
예제 #2
0
파일: plexi.py 프로젝트: paalka/plexi
 def x_error_handler(self, err, request):
     log_error('X protocol error: {0}'.format(err))