'Handle console control events (like Ctrl-C).'

def handle(self, event):

    if (event in (win32con.CTRL_C_EVENT, win32con.CTRL_LOGOFF_EVENT, win32con.CTRL_BREAK_EVENT, win32con.CTRL_SHUTDOWN_EVENT, win32con.CTRL_CLOSE_EVENT)):
        self.bus.log(('Console    event    %s:    shutting    down    bus' % event))
        try:
            self.stop()
        except ValueError:
            pass
        self.bus.exit()
        return 1
    return 0
