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 # Note: These are the base functions common to all packagers, the actual | 5 # Note: These are the base functions common to all packagers, the actual |
6 # packagers are implemented in packagerGecko and packagerChrome. | 6 # packagers are implemented in packagerEdge and packagerChrome. |
Sebastian Noack
2017/10/04 22:22:18
Nit: We usually list Chrome before Edge everywhere
tlucas
2017/10/05 10:10:30
Done.
| |
7 | 7 |
8 import sys | 8 import sys |
9 import os | 9 import os |
10 import re | 10 import re |
11 import subprocess | 11 import subprocess |
12 import json | 12 import json |
13 import zipfile | 13 import zipfile |
14 from StringIO import StringIO | 14 from StringIO import StringIO |
15 from chainedconfigparser import ChainedConfigParser | 15 from chainedconfigparser import ChainedConfigParser |
16 | 16 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 | 135 |
136 def zip(self, outFile, sortKey=None, compression=zipfile.ZIP_DEFLATED): | 136 def zip(self, outFile, sortKey=None, compression=zipfile.ZIP_DEFLATED): |
137 with zipfile.ZipFile(outFile, 'w', compression) as zf: | 137 with zipfile.ZipFile(outFile, 'w', compression) as zf: |
138 for name in sorted(self, key=sortKey): | 138 for name in sorted(self, key=sortKey): |
139 zf.writestr(name, self[name]) | 139 zf.writestr(name, self[name]) |
140 | 140 |
141 def zipToString(self, sortKey=None): | 141 def zipToString(self, sortKey=None): |
142 buffer = StringIO() | 142 buffer = StringIO() |
143 self.zip(buffer, sortKey=sortKey) | 143 self.zip(buffer, sortKey=sortKey) |
144 return buffer.getvalue() | 144 return buffer.getvalue() |
OLD | NEW |