12from os.path
import abspath, basename, dirname, exists, join, split, relpath
13import base64, re, os, shutil, subprocess, sys, tempfile, optparse
16CLIENT_TOOLS_PATH = dirname(abspath(__file__))
17CLIENT_PATH = dirname(CLIENT_TOOLS_PATH)
20sys.path.append(CLIENT_TOOLS_PATH)
25 outDirBase =
'outcode'
26 outfile =
join(outDirBase, infile)
27 print(
'converting %s to %s' % (infile, outfile))
29 if 'dart' in options.target:
30 htmlconverter.convertForDartium(infile, outDirBase,
31 outfile.replace(
'.html',
'-dart.html'),
33 if 'js' in options.target:
34 htmlconverter.convertForChromium(infile, options.dartc_extra_flags,
35 outfile.replace(
'.html',
'-js.html'),
40 """ Constructs a parser for extracting flags from the command line. """
41 result = optparse.OptionParser()
42 result.add_option(
"-t",
44 help=
"The target html to generate",
47 result.add_option(
"--verbose",
48 help=
"Print verbose output",
51 result.add_option(
"--dartc_extra_flags",
52 help=
"Additional flag text to pass to dartc",
61 for filename
in os.listdir(APP_PATH):
62 fName, fExt = os.path.splitext(filename)
63 if fExt.lower() ==
'.html':
64 htmlFiles.append(filename)
73 options, args = parser.parse_args()
78 REL_APP_PATH = relpath(APP_PATH)
80 infile =
join(REL_APP_PATH, file)
84if __name__ ==
'__main__':
def print(*args, **kwargs)
def convertOne(infile, options)
static SkString join(const CommandLineFlags::StringArray &)