def find_sockfile(display=None):
 display = (display or os.environ.get('DISPLAY') or ':0.0')
 if ('.' not in display):
  display += '.0'
 cache_directory = get_cache_dir()
 return os.path.join(cache_directory, (SOCKBASE % display))

def find_sockfile ( display = None ) : display = ( display or os . environ . get ( 'DISPLAY' ) or ':0.0' ) if ( '.' not in display ) : display += '.0' cache_directory = get_cache_dir ( ) return os . path . join ( cache_directory , ( SOCKBASE % display ) )
finds the appropriate socket file .