def load_theme_plugins():
 if (not pkg_resources):
  return []
 theme_paths = []
 for plugin in pkg_resources.iter_entry_points('sphinx_themes'):
  func_or_path = plugin.load()
  try:
   path = func_or_path()
  except:
   path = func_or_path
  if isinstance(path, basestring):
   theme_paths.append(path)
  else:
   raise ThemeError(('Plugin %r does not response correctly.' % plugin.module_name))
 return theme_paths

def load_theme_plugins ( ) : if ( not pkg_resources ) : return [ ] theme_paths = [ ] for plugin in pkg_resources . iter_entry_points ( 'sphinx_themes' ) : func_or_path = plugin . load ( ) try : path = func_or_path ( ) except : path = func_or_path if isinstance ( path , basestring ) : theme_paths . append ( path ) else : raise ThemeError ( ( 'Plugin %r does not response correctly.' % plugin . module_name ) ) return theme_paths
load plugins by usingsphinx_themes section in setuptools entry_points .