def getDisplayValue(displayValue):
    """Takes potentially multilined value and converts it to a single line"""
    lines = str(displayValue).splitlines()
    lineCount = len(lines)
    if lineCount > 1:
        nonEmptyIndex = None
        index = -1
        for line in lines:
            index += 1
            if len(line.strip()) > 0:
                nonEmptyIndex = index
                break
        if nonEmptyIndex is None:
            displayValue = ''
        else:
            if len(lines[nonEmptyIndex]) > 128:
                displayValue = lines[nonEmptyIndex][:128] + '<...>'
            else:
                displayValue = lines[nonEmptyIndex]
                if nonEmptyIndex < lineCount - 1:
                    displayValue += '<...>'
            if nonEmptyIndex > 0:
                displayValue = '<...>' + displayValue
    elif lineCount == 1:
        if len(lines[0]) > 128:
            displayValue = lines[0][:128] + '<...>'
        else:
            value = lines[0]
    return displayValue
