'Attempt to parse a single line from the server.
@type line: L{bytes}
@param line: The line from the server, without the line delimiter.
@raise IllegalServerResponse: If the line or some part of the line
does not represent an allowed message from the server at this time.'

def lineReceived(self, line):

    if (self.timeout > 0):
        self.resetTimeout()
    lastPart = line.rfind('{')
    if (lastPart != (-1)):
        lastPart = line[(lastPart + 1):]
        if lastPart.endswith('}'):
            try:
                octets = int(lastPart[:(-1)])
            except ValueError:
                raise IllegalServerResponse(line)
            if (self._parts is None):
                (self._tag, parts) = line.split(None, 1)
            else:
                parts = line
            self._setupForLiteral(parts, octets)
            return
    if (self._parts is None):
        self._regularDispatch(line)
    else:
        self._parts.append(line)
        (tag, rest) = (self._tag, ''.join(self._parts))
        self._tag = self._parts = None
        self.dispatchCommand(tag, rest)
