def _readline_from_keyboard(self):
        c=self.console
        def nop(e):
            pass
        while 1:
            self._update_line()
            lbuf=self.l_buffer
            log_sock("point:%d mark:%d selection_mark:%d"%(lbuf.point,lbuf.mark,lbuf.selection_mark))
            try:
                event = c.getkeypress()
                log_sock(u">>%s"%event)
            except __HOLE__:
                from pyreadline.keysyms.common import KeyPress
                from pyreadline.console.event import Event
                event=Event(0,0)
                event.char="c"
                event.keyinfo=KeyPress("c",shift=False,control=True,meta=False,keyname=None)
                log_sock("KBDIRQ")
                if self.allow_ctrl_c:
                    now=time.time()
                    if (now-self.ctrl_c_timeout)<self.ctrl_c_tap_time_interval:
                        raise
                    else:
                        self.ctrl_c_timeout=now
                    pass
                else:
                    raise
            if self.next_meta:
                self.next_meta = False
                control, meta, shift, code = event.keyinfo
                event.keyinfo = (control, True, shift, code)

            #Process exit keys. Only exit on empty line
            keyinfo=event.keyinfo.tuple()
            if keyinfo in self.exit_dispatch:
                if lineobj.EndOfLine(self.l_buffer) == 0:
                    raise EOFError
            if len(keyinfo[-1])>1:
                default=nop
            else:
                default=self.self_insert
            dispatch_func = self.key_dispatch.get(keyinfo,default)
            
            log("readline from keyboard:%s,%s"%(keyinfo,dispatch_func))
            log_sock((u"%s|%s"%(ensure_unicode(format(keyinfo)),dispatch_func.__name__)),"bound_function")
            r = None
            if dispatch_func:
                r = dispatch_func(event)
                self._keylog(dispatch_func,self.l_buffer)
                self.l_buffer.push_undo()

            self.previous_func = dispatch_func
            if r:
                self._update_line()
                break
dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/site-packages/pyreadline/modes/emacs.py/EmacsMode._readline_from_keyboard