Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: packagerChrome.py

Issue 29326188: Issue 3039 - Generate qunit/index.html based on metadata (Closed)
Patch Set: Created Sept. 9, 2015, 3:35 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « background.html.tmpl ('k') | packagerSafari.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerChrome.py
diff --git a/packagerChrome.py b/packagerChrome.py
index 6af4df9c7ff5d7068253c26a93371cc3548664ca..36cae1b300c96eb5aff29ca9dcbad4bd56656a2d 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -57,6 +57,12 @@ def makeIcons(files, filenames):
icons[width] = filename
return icons
+def createScriptPage(params, template_name, script_option):
+ template = getTemplate(template_name, autoEscape=True)
+ return template.render(
+ scripts=params['metadata'].get(*script_option).split()
+ ).encode('utf-8')
+
def createManifest(params, files):
template = getTemplate('manifest.json.tmpl')
templateData = dict(params)
@@ -357,6 +363,10 @@ def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
'lib/info.js' not in files):
files['lib/info.js'] = createInfoModule(params)
+ if metadata.has_option('general', 'testScripts'):
+ files['qunit/index.html'] = createScriptPage(params, 'testIndex.html.tmpl',
+ ('general', 'testScripts'))
+
zipdata = files.zipToString()
signature = None
pubkey = None
« no previous file with comments | « background.html.tmpl ('k') | packagerSafari.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld