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

Side by Side Diff: packagerChrome.py

Issue 29333461: Issue 3516 - Add support for optional permissions (Closed)
Patch Set: Created Jan. 14, 2016, 4:21 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « manifest.json.tmpl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This Source Code Form is subject to the terms of the Mozilla Public 3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 6
7 import sys 7 import sys
8 import os 8 import os
9 import re 9 import re
10 import json 10 import json
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 templateData[opt] = {'icon': icon, 'popup': popup} 93 templateData[opt] = {'icon': icon, 'popup': popup}
94 94
95 if metadata.has_option('general', 'icons'): 95 if metadata.has_option('general', 'icons'):
96 templateData['icons'] = makeIcons(files, metadata.get('general', 'icons').sp lit()) 96 templateData['icons'] = makeIcons(files, metadata.get('general', 'icons').sp lit())
97 97
98 if metadata.has_option('general', 'permissions'): 98 if metadata.has_option('general', 'permissions'):
99 templateData['permissions'] = re.split(r'\s+', metadata.get('general', 'perm issions')) 99 templateData['permissions'] = re.split(r'\s+', metadata.get('general', 'perm issions'))
100 if params['experimentalAPI']: 100 if params['experimentalAPI']:
101 templateData['permissions'].append('experimental') 101 templateData['permissions'].append('experimental')
102 102
103 if metadata.has_option('general', 'optionalPermissions'):
104 templateData['optionalPermissions'] = re.split(
Sebastian Noack 2016/01/14 16:26:11 Note that re.split(r'\s+', s) is equivalent to s.s
kzar 2016/01/14 16:39:07 I know, just staying consistent with the surroundi
Sebastian Noack 2016/01/14 16:41:54 Feel free to change it in the other places as well
105 r'\s+', metadata.get('general', 'optionalPermissions')
106 )
107
103 if metadata.has_option('general', 'backgroundScripts'): 108 if metadata.has_option('general', 'backgroundScripts'):
104 templateData['backgroundScripts'] = re.split(r'\s+', metadata.get('general', 'backgroundScripts')) 109 templateData['backgroundScripts'] = re.split(r'\s+', metadata.get('general', 'backgroundScripts'))
105 if params['devenv']: 110 if params['devenv']:
106 templateData['backgroundScripts'].append('devenvPoller__.js') 111 templateData['backgroundScripts'].append('devenvPoller__.js')
107 112
108 if metadata.has_option('general', 'webAccessible') and metadata.get('general', 'webAccessible') != '': 113 if metadata.has_option('general', 'webAccessible') and metadata.get('general', 'webAccessible') != '':
109 templateData['webAccessible'] = re.split(r'\s+', metadata.get('general', 'we bAccessible')) 114 templateData['webAccessible'] = re.split(r'\s+', metadata.get('general', 'we bAccessible'))
110 115
111 if metadata.has_section('contentScripts'): 116 if metadata.has_section('contentScripts'):
112 contentScripts = [] 117 contentScripts = []
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 files['qunit/index.html'] = createScriptPage(params, 'testIndex.html.tmpl', 373 files['qunit/index.html'] = createScriptPage(params, 'testIndex.html.tmpl',
369 ('general', 'testScripts')) 374 ('general', 'testScripts'))
370 375
371 zipdata = files.zipToString() 376 zipdata = files.zipToString()
372 signature = None 377 signature = None
373 pubkey = None 378 pubkey = None
374 if keyFile != None: 379 if keyFile != None:
375 signature = signBinary(zipdata, keyFile) 380 signature = signBinary(zipdata, keyFile)
376 pubkey = getPublicKey(keyFile) 381 pubkey = getPublicKey(keyFile)
377 writePackage(outFile, pubkey, signature, zipdata) 382 writePackage(outFile, pubkey, signature, zipdata)
OLDNEW
« 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