def start_undoable_rl(interpreter, interparg): for command, predicate in interps.interpreters: if predicate(interpreter): return run_with_listeners(command + interparg) else: modify_env_with_modified_rl() run_with_listeners(interpreter + interparg)
def start_undoable_rl(interpreter, interparg): """Run an interpreter either with an undo script or with a generic method. If an interpreter matches the first argument, run script like that. Otherwise run that command in an environment where a modified readline will be used instead of the standard one.""" for command, predicate in interps.interpreters: if predicate(interpreter): return run_with_listeners(command + interparg) else: modify_env_with_modified_rl() return run_with_listeners([interpreter] + interparg)