def escape(string, size=55):
    """Escape string for dot file"""
    if not size or not string:
        return ''
    if len(string) > size:
        half_size = (size - 5) // 2
        string = string[:half_size] + ' ... ' + string[-half_size:]
    return '' if string is None else string.replace('"', '\\"')
