efb3773 Add common helper for interactive prompts

2 files Authored by pviktori 12 years ago, Committed by rcritten 12 years ago,
    Add common helper for interactive prompts
    
    This patch adds a common method, textui.prompt_helper, that handles
    encoding, decoding and error handling for interactive prompts.
    On EOFError (Ctrl+D) or  KeyboardInterrupt (Ctrl+C), it raises
    a new InvocationError, PromptFailed.
    
    The helper is used in prompt, prompt_yesno, and prompt_password,
    each of which originally only handled one of Ctrl+C and Ctrl+D.
    This fixes https://fedorahosted.org/freeipa/ticket/2345
    And it means prompt_yesno will no longer return None on error.
    
    A minor fix restores errors.py's ability print out the list of
    errors when run as a script.
    
        
file modified
+30 -29
file modified
+10 -1