def squish(s, n):
    """Truncate the middle of a string s so that it fits within a length n."""
    if len(s) > n:
        if n > 30:
            s = '{} ... {}'.format(s[0:int(n / 2) - 2], s[-int(n / 2) + 2:])
        else:
            s = '{}…{}'.format(s[0:int(n / 2)], s[-int(n / 2) + 1:])
    return s
