Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: remoting/webapp/build-html.py

Issue 498773005: Add some remoting targets to GN build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/BUILD.gn ('k') | ui/wm/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/build-html.py
diff --git a/remoting/webapp/build-html.py b/remoting/webapp/build-html.py
index 550265d65cc015c0476e26e27fcce541807ac3ca..5c74b5f2d6eecf68e4ede19bd69f920a0cbf12b3 100755
--- a/remoting/webapp/build-html.py
+++ b/remoting/webapp/build-html.py
@@ -32,11 +32,12 @@ class HtmlChecker(HTMLParser):
class GenerateWebappHtml:
- def __init__(self, template_files, js_files, instrumented_js_files):
+ def __init__(self, template_files, js_files, instrumented_js_files,
+ template_rel_dir):
self.js_files = js_files
self.instrumented_js_files = instrumented_js_files
-
+ self.template_rel_dir = template_rel_dir
self.templates_expected = set()
for template in template_files:
@@ -69,7 +70,8 @@ class GenerateWebappHtml:
return False
def processTemplate(self, output, template_file, indent):
- with open(template_file, 'r') as input_template:
+ with open(os.path.join(self.template_rel_dir, template_file), 'r') as \
+ input_template:
first_line = True
skip_header_comment = False
@@ -128,6 +130,10 @@ def parseArgs():
nargs='*',
default=[],
help='Javascript to include and instrument for code coverage')
+ parser.add_argument(
+ '--dir-for-templates',
+ default = ".",
+ help='Directory template references in html are relative to')
parser.add_argument('output_file')
parser.add_argument('input_template')
return parser.parse_args(sys.argv[1:])
@@ -146,7 +152,8 @@ def main():
# Generate the main HTML file from the templates.
with open(out_file, 'w') as output:
- gen = GenerateWebappHtml(args.templates, js_files, args.instrument_js)
+ gen = GenerateWebappHtml(args.templates, js_files, args.instrument_js,
+ args.dir_for_templates)
gen.processTemplate(output, args.input_template, 0)
# Verify that all the expected templates were found.
« no previous file with comments | « remoting/webapp/BUILD.gn ('k') | ui/wm/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698