'Parse the line into a command name and a string containing the
arguments.  Returns a tuple containing (command, args, line).
\'command\' and \'args\' may be None if line couldn\'t be parsed.  Check for
registered special handlers.'

def parseline(self, line):

    line = line.strip()
    if (not line):
        return (None, None, line)
    if (line[(-1):] in self.helpKeys):
        line = ((self.helpKeys[line[(-1):]] + '    ') + line[:(-1)])
    if (line[0] in self.shortcutKeys):
        line = ((self.shortcutKeys[line[0]] + '    ') + line[1:])
    (i, n) = (0, len(line))
    while ((i < n) and (line[i] in self.identchars)):
        i = (i + 1)
    (cmd, arg) = (line[:i], line[i:].strip())
    return (cmd, arg, line)
