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

Delta Between Two Patch Sets: packagerChrome.py

Issue 29608569: Issue 6037 - Allow popup icons without popup (Closed) Base URL: https://hg.adblockplus.org/buildtools/
Left Patch Set: Created Nov. 14, 2017, 3:41 p.m.
Right Patch Set: Use endswith Created Nov. 14, 2017, 6:39 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 glob 6 import glob
7 import io 7 import io
8 import json 8 import json
9 import os 9 import os
10 import re 10 import re
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if not metadata.has_option('general', opt): 79 if not metadata.has_option('general', opt):
80 continue 80 continue
81 81
82 icons = metadata.get('general', opt).split() 82 icons = metadata.get('general', opt).split()
83 if not icons: 83 if not icons:
84 continue 84 continue
85 85
86 if len(icons) == 1: 86 if len(icons) == 1:
87 # ... = icon.png 87 # ... = icon.png
88 icon, popup = icons[0], None 88 icon, popup = icons[0], None
89 elif re.search('\.html$', icons[-1]): 89 elif icons[-1].endswith('.html'):
tlucas 2017/11/14 16:10:22 Nit: since this is simply a test if icons[-1] ends
Manish Jethani 2017/11/14 18:40:10 Done.
90 if len(icons) == 2: 90 if len(icons) == 2:
91 # ... = icon.png popup.html 91 # ... = icon.png popup.html
92 icon, popup = icons 92 icon, popup = icons
93 else: 93 else:
94 # ... = icon-19.png icon-38.png popup.html 94 # ... = icon-19.png icon-38.png popup.html
95 popup = icons.pop() 95 popup = icons.pop()
96 icon = makeIcons(files, icons) 96 icon = makeIcons(files, icons)
97 else: 97 else:
98 # ... = icon-16.png icon-32.png icon-48.png 98 # ... = icon-16.png icon-32.png icon-48.png
99 icon = makeIcons(files, icons) 99 icon = makeIcons(files, icons)
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 if devenv: 397 if devenv:
398 add_devenv_requirements(files, metadata, params) 398 add_devenv_requirements(files, metadata, params)
399 399
400 zipdata = files.zipToString() 400 zipdata = files.zipToString()
401 signature = None 401 signature = None
402 pubkey = None 402 pubkey = None
403 if keyFile != None: 403 if keyFile != None:
404 signature = signBinary(zipdata, keyFile) 404 signature = signBinary(zipdata, keyFile)
405 pubkey = getPublicKey(keyFile) 405 pubkey = getPublicKey(keyFile)
406 writePackage(outFile, pubkey, signature, zipdata) 406 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