def command_devserver_html():

    def compactor(dev_filename, rel_filename):
        # Use compactor to generate release version.
        echo('Compacting: %s -> %s' % (dev_filename, rel_filename))
        source_data = open(dev_filename, 'r').read()
        try:
            # Verify that the html file is correct
            htmlparser = HTMLParser(NullFormatter())
            htmlparser.feed(source_data)
            htmlparser.close()
            # Now try to minify
            output_file = open(rel_filename, 'wb')
            compactor = HTMLMinifier(output_file.write, True)
            compactor.feed(source_data)
            compactor.close()
            output_file.close()
        except HTMLParseError as e:
            error(str(e))
            exit(1)

    versions_yaml = os.path.join(TURBULENZ_LOCAL, 'config', 'html_versions.yaml')
    dev_path = os.path.join(TURBULENZ_LOCAL, 'public', 'development')
    rel_path = os.path.join(TURBULENZ_LOCAL, 'public', 'release')
    ext = 'html'

    mkdir(os.path.join(rel_path, ext))

    try:
        compact(dev_path, rel_path, versions_yaml, ext, compactor)
    except __HOLE__ as e:
        error('Failed to save html version details: %s' % str(e))
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/local_server.py/command_devserver_html