def formatName(repStr, maxLength):
    """format the string name so that no line exceeds maxLength characters
    """
    if len(repStr)>maxLength:
        pt = 0
        frepStr = ""
        while pt < len(repStr):
            frepStr += repStr[pt:min(pt+maxLength, len(repStr))]+'\n'
            pt += maxLength
        frepStr = frepStr[:-1]
    else:
        frepStr = repStr
    return frepStr