ppapi/c/documentation/doxy_cleanup.py
def main():
  '''Main entry for the doxy_cleanup utility

  doxy_cleanup takes a list of html files and modifies them in place.'''

  parser = optparse.OptionParser(usage='Usage: %prog [options] files...')

  parser.add_option('-m', '--move', dest='move', action='store_true',
                    default=False, help='move html files to "original_html"')

  options, files = parser.parse_args()

  if not files:
    parser.print_usage()
    return 1

  for filename in files:
    try:
      with open(filename, 'r') as file:
        html = file.read()

      print("Processing %s" % filename)
      fixer = HTMLFixer(html)
      fixer.FixAll()
      with open(filename, 'w') as file:
        file.write(str(fixer))
      if options.move:
        new_directory = os.path.join(
            os.path.dirname(os.path.dirname(filename)), 'original_html')
        if not os.path.exists(new_directory):
          os.mkdir(new_directory)
        shutil.move(filename, new_directory)
    except:
      print("Error while processing %s" % filename)
      raise

  return 0
Main entry for the doxy_cleanup utility

  doxy_cleanup takes a list of html files and modifies them in place.
Main entry for the doxy_cleanup utility
doxy_cleanup takes a list of html files and modifies them in place.
Main entry for the doxy_cleanup utility doxy_cleanup takes a list of html files and modifies them in place .
def main():
  parser = optparse.OptionParser(usage='Usage: %prog [options] files...')
  parser.add_option('-m', '--move', dest='move', action='store_true',
                    default=False, help='move html files to "original_html"')
  options, files = parser.parse_args()
  if not files:
    parser.print_usage()
    return 1
  for filename in files:
    try:
      with open(filename, 'r') as file:
        html = file.read()
      print("Processing %s" % filename)
      fixer = HTMLFixer(html)
      fixer.FixAll()
      with open(filename, 'w') as file:
        file.write(str(fixer))
      if options.move:
        new_directory = os.path.join(
            os.path.dirname(os.path.dirname(filename)), 'original_html')
        if not os.path.exists(new_directory):
          os.mkdir(new_directory)
        shutil.move(filename, new_directory)
    except:
      print("Error while processing %s" % filename)
      raise
  return 0
def main ( ) : parser = optparse . OptionParser ( usage = 'Usage: %prog [options] files...' ) parser . add_option ( '-m' , '--move' , dest = 'move' , action = 'store_true' , default = False , help = 'move html files to "original_html"' ) options , files = parser . parse_args ( ) if not files : parser . print_usage ( ) return 1 for filename in files : try : with open ( filename , 'r' ) as file : html = file . read ( ) print ( "Processing %s" % filename ) fixer = HTMLFixer ( html ) fixer . FixAll ( ) with open ( filename , 'w' ) as file : file . write ( str ( fixer ) ) if options . move : new_directory = os . path . join ( os . path . dirname ( os . path . dirname ( filename ) ) , 'original_html' ) if not os . path . exists ( new_directory ) : os . mkdir ( new_directory ) shutil . move ( filename , new_directory ) except : print ( "Error while processing %s" % filename ) raise return 0
Main entry for the doxy_cleanup utility
doxy_cleanup takes a list of html files and modifies them in place.
Main entry for the doxy_cleanup utility doxy_cleanup takes a list of html files and modifies them in place .
'''Main entry for the doxy_cleanup utility

  doxy_cleanup takes a list of html files and modifies them in place.'''