def get_lines(txt):
    """
    Break text to individual lines.

    :returns tuple: a tuple containing the next line and whether the line
        contained a newline charater.
    """
    if not txt:
        return iter([])
    start = 0
    try:
        while True:
            i = txt.index('\n', start)
            yield txt[start:i], True
            start = i + 1
            if start >= len(txt):
                break
    except:
        yield txt[start:], False
