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: Avoid hardcoding "Adblock Plus", instead use basename Created Sept. 9, 2015, 4:28 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..237cb2167ea5d84824d3602ddf20308a0018d828 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -57,6 +57,13 @@ 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(
+ basename=params['metadata'].get('general', 'basename'),
+ scripts=params['metadata'].get(*script_option).split()
+ ).encode('utf-8')
+
def createManifest(params, files):
template = getTemplate('manifest.json.tmpl')
templateData = dict(params)
@@ -357,6 +364,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