Ejemplo n.º 1
0
def event_hook():
    """event_hook() -- internal readline callback. Do not call.
    """
    try:
        res = sched.process(0)
        if (not res):
            Readline.quitnow = True
            readline.set_done(1)
    except Exception, ex:
        (typ, val, tb) = sys.exc_info()
        biglist = traceback.format_exception(typ, val, tb)
        print 'Exception during sched.process():', str(ex)
        print ''.join(biglist)
Ejemplo n.º 2
0
        res = sched.process(0)
        if (not res):
            Readline.quitnow = True
            readline.set_done(1)
    except Exception, ex:
        (typ, val, tb) = sys.exc_info()
        biglist = traceback.format_exception(typ, val, tb)
        print 'Exception during sched.process():', str(ex)
        print ''.join(biglist)
    if (Readline.received):
        ln = readline.get_line_buffer()
        if (ln != None):
            Readline.interruption = (ln,
                readline.get_point(),
                readline.get_mark())
        readline.set_done(1)
        
def startup_hook():
    """startup_hook() -- internal readline callback. Do not call.
    """
    if (Readline.interruption != None):
        readline.insert_text(Readline.interruption[0])
        readline.set_point(Readline.interruption[1])
        readline.set_mark(Readline.interruption[2])
        Readline.interruption = None

def mainloop():
    """mainloop() -> None

    The procedure for invoking zymb is slightly complicated when you are
    using readline. Instead of calling zymb.sched.process in one of the