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

Delta Between Two Patch Sets: packagerChrome.py

Issue 29404598: Issue 5113 - Adds support for json files to packagerChrome in top level dir (Closed)
Left Patch Set: Created April 6, 2017, 10:57 a.m.
Right Patch Set: remove ignore file changes Created April 6, 2017, 12:29 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # This Source Code Form is subject to the terms of the Mozilla Public 1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this 2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 4
5 import errno 5 import errno
6 import io 6 import io
7 import json 7 import json
8 import os 8 import os
9 import re 9 import re
10 from StringIO import StringIO 10 from StringIO import StringIO
11 import struct 11 import struct
12 import sys 12 import sys
13 import collections 13 import collections
14 14
15 from packager import (readMetadata, getDefaultFileName, getBuildVersion, 15 from packager import (readMetadata, getDefaultFileName, getBuildVersion,
16 getTemplate, Files) 16 getTemplate, Files)
17 17
18 defaultLocale = 'en_US' 18 defaultLocale = 'en_US'
19 19
20 20
21 def getIgnoredFiles(params): 21 def getIgnoredFiles(params):
22 return {'store.description'} 22 return {'store.description'}
23 23
24 24
25 def getPackageFiles(params): 25 def getPackageFiles(params):
26 result = set(('_locales', 'icons', 'jquery-ui', 'lib', 'skin', 'ui', 'ext')) 26 result = {'_locales', 'icons', 'jquery-ui', 'lib', 'skin', 'ui', 'ext'}
27 27
28 if params['devenv']: 28 if params['devenv']:
29 result.add('qunit') 29 result.add('qunit')
30 30
31 baseDir = params['baseDir'] 31 baseDir = params['baseDir']
32 32
33 for file in os.listdir(baseDir): 33 for file in os.listdir(baseDir):
34 if os.path.splitext(file)[1] in {'.json', '.js', '.html', '.xml'}: 34 if os.path.splitext(file)[1] in {'.json', '.js', '.html', '.xml'}:
Sebastian Noack 2017/04/06 11:36:12 Nice, that is exactly how I wanted to change this
Jon Sonesen 2017/04/06 12:05:46 Awesome, Done.
35 result.add(file) 35 result.add(file)
36 return result 36 return result
37 37
38 38
39 def processFile(path, data, params): 39 def processFile(path, data, params):
40 # We don't change anything yet, this function currently only exists here so 40 # We don't change anything yet, this function currently only exists here so
41 # that it can be overridden if necessary. 41 # that it can be overridden if necessary.
42 return data 42 return data
43 43
44 44
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 files['qunit/index.html'] = createScriptPage(params, 'testIndex.html.tmp l', 396 files['qunit/index.html'] = createScriptPage(params, 'testIndex.html.tmp l',
397 ('general', 'testScripts')) 397 ('general', 'testScripts'))
398 398
399 zipdata = files.zipToString() 399 zipdata = files.zipToString()
400 signature = None 400 signature = None
401 pubkey = None 401 pubkey = None
402 if keyFile != None: 402 if keyFile != None:
403 signature = signBinary(zipdata, keyFile) 403 signature = signBinary(zipdata, keyFile)
404 pubkey = getPublicKey(keyFile) 404 pubkey = getPublicKey(keyFile)
405 writePackage(outFile, pubkey, signature, zipdata) 405 writePackage(outFile, pubkey, signature, zipdata)
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld