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

Unified Diff: packagerChrome.py

Issue 29333461: Issue 3516 - Add support for optional permissions (Closed)
Patch Set: Change re.split to .split Created Jan. 14, 2016, 5:01 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 | « manifest.json.tmpl ('k') | no next file » | 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 f26c953a28d52fceb7a030511f52fbb3623aae50..46cbc346981cfae6eb352a4bbb88898ac0b9f7fc 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -93,20 +93,27 @@ def createManifest(params, files):
templateData[opt] = {'icon': icon, 'popup': popup}
if metadata.has_option('general', 'icons'):
- templateData['icons'] = makeIcons(files, metadata.get('general', 'icons').split())
+ templateData['icons'] = makeIcons(files,
+ metadata.get('general', 'icons').split())
if metadata.has_option('general', 'permissions'):
- templateData['permissions'] = re.split(r'\s+', metadata.get('general', 'permissions'))
+ templateData['permissions'] = metadata.get('general', 'permissions').split()
if params['experimentalAPI']:
templateData['permissions'].append('experimental')
+ if metadata.has_option('general', 'optionalPermissions'):
+ templateData['optionalPermissions'] = metadata.get(
+ 'general', 'optionalPermissions').split()
+
if metadata.has_option('general', 'backgroundScripts'):
- templateData['backgroundScripts'] = re.split(r'\s+', metadata.get('general', 'backgroundScripts'))
+ templateData['backgroundScripts'] = metadata.get(
+ 'general', 'backgroundScripts').split()
if params['devenv']:
templateData['backgroundScripts'].append('devenvPoller__.js')
if metadata.has_option('general', 'webAccessible') and metadata.get('general', 'webAccessible') != '':
- templateData['webAccessible'] = re.split(r'\s+', metadata.get('general', 'webAccessible'))
+ templateData['webAccessible'] = metadata.get('general',
+ 'webAccessible').split()
if metadata.has_section('contentScripts'):
contentScripts = []
@@ -115,7 +122,7 @@ def createManifest(params, files):
continue
contentScripts.append({
'matches': ['http://*/*', 'https://*/*'],
- 'js': re.split(r'\s+', scripts),
+ 'js': scripts.split(),
'run_at': run_at,
'all_frames': True,
'match_about_blank': True,
@@ -148,7 +155,7 @@ def convertJS(params, files):
if '/' in file and not files.isIncluded(file):
continue
- sourceFiles = re.split(r'\s+', sources)
+ sourceFiles = sources.split()
args = []
try:
argsStart = sourceFiles.index('--arg')
@@ -222,7 +229,7 @@ def importGeckoLocales(params, files):
importList = map(lambda k: '=' + k, importList)
keys = ' '.join(importList)
- for stringID in re.split(r'\s+', keys):
+ for stringID in keys.split():
noMangling = False
if stringID.startswith('='):
stringID = stringID[1:]
@@ -360,7 +367,7 @@ def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
files['devenvVersion__'] = str(random.random())
if (metadata.has_option('general', 'backgroundScripts') and
- 'lib/info.js' in re.split(r'\s+', metadata.get('general', 'backgroundScripts')) and
+ 'lib/info.js' in metadata.get('general', 'backgroundScripts').split() and
'lib/info.js' not in files):
files['lib/info.js'] = createInfoModule(params)
« no previous file with comments | « manifest.json.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld