def generate_api_docs():
  logging.info('Generating api docs...')
  from epydoc import docparser

  try:
    import roman
  except __HOLE__:
    print ("Could not import module 'roman,' docutils has not been installed"
          "properly")
    print "Please install docutils: http://docutils.sourceforge.net"
    sys.exit(1)

  from common import api
  
  a = docparser.parse_docs(name='common.api')
  variables = a.apidoc_links(imports=False, 
                             packages=False, 
                             submodules=False,
                             bases=False,
                             subclasses=False,
                             private=False,
                             overrides=False)


  public_api_methods = api.PublicApi.methods.keys()
  public_decorators = ['throttle', 'owner_required']

  allowed_names = public_api_methods + public_decorators
  for v in variables:
    if v.name in public_api_methods:
      prefix = "method"
    elif v.name in public_decorators:
      prefix = "deco"
    else:
      continue
    
    filename = '%s_%s.txt' % (prefix, v.name)
    path = os.path.join(DOC_DIR, filename)

    logging.info('  for %s...' % v.name)

    docs = rst_docs(v.value)
    
    f = open(path, 'w')
    f.write(docs)
    f.close()
  logging.info('Finished generating api docs.')
dataset/ETHPy150Open CollabQ/CollabQ/build.py/generate_api_docs