'Handle one line from a response.'

def lineReceived(self, line):

    if (line[(-1):] == '\r'):
        line = line[:(-1)]
    if (self.state == STATUS):
        self.statusReceived(line)
        self.state = HEADER
    elif (self.state == HEADER):
        if ((not line) or (line[0] not in '     DCTB ')):
            if (self._partialHeader is not None):
                header = ''.join(self._partialHeader)
                (name, value) = header.split(':', 1)
                value = value.strip()
                self.headerReceived(name, value)
            if (not line):
                self.allHeadersReceived()
            else:
                self._partialHeader = [line]
        else:
            self._partialHeader.append(line)
