def shorten_list(l, max_length=15):
    """ If list longer than max_length, returned shortened version"""
    length = len(l)
    if length > max_length:
        sl = l[0:max_length]
        sl.append("...%i total" % length)
    else:
        sl = l
    return sl