'Dispatch a received line for processing.
The choice of function to handle the received line is based on the
type of response expected to the command sent to the server and how
much of that response has been received.
An expected one line response to command X is handled by handle_X().
The first line of a multi-line response to command X is also handled by
handle_X().  Subsequent lines of the multi-line response are handled by
handle_X_continue() except for the last line which is handled by
handle_X_end().
@type line: L{bytes}
@param line: A received line.'

def lineReceived(self, line):

    if ((self.mode == SHORT) or (self.mode == FIRST_LONG)):
        self.mode = NEXT[self.mode]
        self._dispatch(self.command, self.handle_default, line)
    elif (self.mode == LONG):
        if (line == '.'):
            self.mode = NEXT[self.mode]
            self._dispatch((self.command + '_end'), None)
            return
        if (line[:1] == '.'):
            line = line[1:]
        self._dispatch((self.command + '_continue'), None, line)
