def find_sockfiles():
 paths = []
 for dir in SEARCH_DIRS:
  if ((not os.path.isdir(dir)) or (not os.access(dir, os.R_OK))):
   continue
  for name in os.listdir(dir):
   subdir = os.path.join(dir, name)
   if ((not os.path.isdir(subdir)) or (not os.access(subdir, os.R_OK))):
    continue
   for subname in os.listdir(subdir):
    path = os.path.join(subdir, subname)
    if utils.is_sockfile(path):
     paths.append(path)
     break
 for sockfile in DEFAULT_SOCKFILES:
  if (not utils.is_sockfile(sockfile)):
   continue
  paths.append(sockfile)
 return paths

def find_sockfiles ( ) : paths = [ ] for dir in SEARCH_DIRS : if ( ( not os . path . isdir ( dir ) ) or ( not os . access ( dir , os . R_OK ) ) ) : continue for name in os . listdir ( dir ) : subdir = os . path . join ( dir , name ) if ( ( not os . path . isdir ( subdir ) ) or ( not os . access ( subdir , os . R_OK ) ) ) : continue for subname in os . listdir ( subdir ) : path = os . path . join ( subdir , subname ) if utils . is_sockfile ( path ) : paths . append ( path ) break for sockfile in DEFAULT_SOCKFILES : if ( not utils . is_sockfile ( sockfile ) ) : continue paths . append ( sockfile ) return paths
returns a list of paths to socket files to monitor .