def serReadUntil(ser, expected):
    """
    Read from a serial port until the expected text appears

    :param ser:
        The serial port to read from
    :param expected:
        The expected string
    :return:
        The last line read
    """
    line = ""
    while(not(expected in str(line))):
        line = ser.readline()
    return line