Left: | ||
Right: |
OLD | NEW |
---|---|
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 Loading... | |
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 len(icons) == 2: | 89 elif re.search('\.html$', icons[-1]): |
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 # ... = icon.png popup.html | 90 if len(icons) == 2: |
91 icon, popup = icons | 91 # ... = icon.png popup.html |
92 icon, popup = icons | |
93 else: | |
94 # ... = icon-19.png icon-38.png popup.html | |
95 popup = icons.pop() | |
96 icon = makeIcons(files, icons) | |
92 else: | 97 else: |
93 # ... = icon-19.png icon-38.png popup.html | 98 # ... = icon-16.png icon-32.png icon-48.png |
94 popup = icons.pop() | |
95 icon = makeIcons(files, icons) | 99 icon = makeIcons(files, icons) |
100 popup = None | |
96 | 101 |
97 templateData[opt] = {'icon': icon, 'popup': popup} | 102 templateData[opt] = {'icon': icon, 'popup': popup} |
98 | 103 |
99 if metadata.has_option('general', 'icons'): | 104 if metadata.has_option('general', 'icons'): |
100 templateData['icons'] = makeIcons(files, | 105 templateData['icons'] = makeIcons(files, |
101 metadata.get('general', 'icons').split ()) | 106 metadata.get('general', 'icons').split ()) |
102 | 107 |
103 if metadata.has_option('general', 'permissions'): | 108 if metadata.has_option('general', 'permissions'): |
104 templateData['permissions'] = metadata.get('general', 'permissions').spl it() | 109 templateData['permissions'] = metadata.get('general', 'permissions').spl it() |
105 | 110 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 if devenv: | 397 if devenv: |
393 add_devenv_requirements(files, metadata, params) | 398 add_devenv_requirements(files, metadata, params) |
394 | 399 |
395 zipdata = files.zipToString() | 400 zipdata = files.zipToString() |
396 signature = None | 401 signature = None |
397 pubkey = None | 402 pubkey = None |
398 if keyFile != None: | 403 if keyFile != None: |
399 signature = signBinary(zipdata, keyFile) | 404 signature = signBinary(zipdata, keyFile) |
400 pubkey = getPublicKey(keyFile) | 405 pubkey = getPublicKey(keyFile) |
401 writePackage(outFile, pubkey, signature, zipdata) | 406 writePackage(outFile, pubkey, signature, zipdata) |
OLD | NEW |