'Repeatedly issue a prompt, accept input, parse an initial prefix
off the received input, and dispatch to action methods, passing them
the remainder of the line as argument.'

def cmdloop(self):

    self.preloop()
    self.io.pre_input(self.complete)
    try:
        stop = None
        while (not stop):
            if self.cmdqueue:
                line = self.cmdqueue.pop(0)
            else:
                line = self.io.get_input(self.prompt)
            stop = self.runcmd(line)
        self.postloop()
    finally:
        self.io.post_input()
