'Returns a single line of input (may be incomplete SQL) from self.stdin.
If EOF is reached then return None.  Do not include trailing
newline in return.'

def getline(self, prompt=''):

    self.stdout.flush()
    self.stderr.flush()
    try:
        if self.interactive:
            if (self.stdin is sys.stdin):
                c = (self.colour.prompt, self.colour.prompt_)
                if (self._using_readline and (sys.platform != 'win32')):
                    c = ((('\x01' + c[0]) + '\x02'), (('\x01' + c[1]) + '\x02'))
                line = (self._raw_input(((c[0] + prompt) + c[1])) + '\n')
            else:
                self.write(self.stdout, prompt)
                line = self.stdin.readline()
        else:
            line = self.stdin.readline()
        self.input_line_number += 1
        if (sys.version_info < (3, 0)):
            if (type(line) != unicode):
                enc = getattr(self.stdin, 'encoding', self.encoding[0])
                if (not enc):
                    enc = self.encoding[0]
                line = line.decode(enc)
    except EOFError:
        return None
    if (len(line) == 0):
        return None
    if (line[(-1)] == '\n'):
        line = line[:(-1)]
    return line
