def limit(string, print_length=58):
    """Limit the length of a string to print_length characters
    Replaces the middle with ...
    """
    if len(string) > print_length:
        trim = int((print_length-3)/2)
        return string[:trim] + '...' + string[-trim:]
    else:
        return string