'Parse line and execute command.'

def onecmd(self, line):

    if isinstance(line, string_t):
        line = shlex.split(safe_str(line))
    (cmd, arg, line) = self.parseline(line)
    if (not line):
        return self.emptyline()
    self.lastcmd = line
    self.counter = next(self.inc_counter)
    try:
        self.respond(self.dispatch(cmd, arg))
    except (AttributeError, KeyError) as exc:
        self.default(line)
    except Exception as exc:
        self.say(exc)
        self.needs_reconnect = True
