def input_object(prompt_text, cast = None, default = None,
                 prompt_ext = ': ', castarg = [], castkwarg = {}):
    while True:
        stdout.write(prompt_text)
        value = stdout.raw_input(prompt_ext)
        if value == '': return default
        try:
            if cast != None: value = cast(value, *castarg, **castkwarg)
        except ValueError, details:
            if cast in NICE_INPUT_ERRORS: # see comment above this constant
                stderr.write(ERROR_MESSAGE % (NICE_INPUT_ERRORS[cast] % details))
            else: stderr.write(ERROR_MESSAGE % (DEFAULT_INPUT_ERRORS % str(details)))
            continue
        return value
Create and remember a L{LivePage} instance, and an element for testing.
dataset/ETHPy150Open jart/fabulous/fabulous/prompt.py/input_object--crossover with--dataset/ETHPy150Open twisted/nevow/nevow/test/test_athena.py/ConnectionCallbackTests.setUp