'Write the given text as a prompt to the console output, then read a
result from the console input.
@param text: Something to present to a user to solicit a yes or no
response.
@type text: L{bytes}
@return: a L{Deferred} which fires with L{True} when the user answers
\'yes\' and L{False} when the user answers \'no\'.  It may errback if
there were any I/O errors.'

def prompt(self, text):

    d = defer.succeed(None)
    def body(ignored):
        with closing(self.opener()) as f:
            f.write(text)
            while True:
                answer = f.readline().strip().lower()
                if (answer == 'yes'):
                    return True
                elif (answer == 'no'):
                    return False
                else:
                    f.write("Please    type    'yes'    or    'no':    ")
    return d.addCallback(body)
