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 base64 | 5 import base64 |
6 import hashlib | 6 import hashlib |
7 import json | 7 import json |
8 import mimetypes | 8 import mimetypes |
9 import os | 9 import os |
10 import zipfile | 10 import zipfile |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 w['min'], w['max'] = metadata.get('compat', 'windows').split('/') | 92 w['min'], w['max'] = metadata.get('compat', 'windows').split('/') |
93 params['version'] = get_appx_version(metadata, build_num) | 93 params['version'] = get_appx_version(metadata, build_num) |
94 | 94 |
95 metadata_suffix = 'release' if release_build else 'devbuild' | 95 metadata_suffix = 'release' if release_build else 'devbuild' |
96 app_extension_id = 'extension_id_' + metadata_suffix | 96 app_extension_id = 'extension_id_' + metadata_suffix |
97 if metadata.has_option('general', app_extension_id): | 97 if metadata.has_option('general', app_extension_id): |
98 params['app_extension_id'] = metadata.get('general', app_extension_id) | 98 params['app_extension_id'] = metadata.get('general', app_extension_id) |
99 else: | 99 else: |
100 params['app_extension_id'] = 'EdgeExtension' | 100 params['app_extension_id'] = 'EdgeExtension' |
101 | 101 |
102 app_id = 'app_id_' + metadata_suffix | 102 params['app_id'] = packager.get_app_id(release_build, metadata) |
103 params['app_id'] = metadata.get('general', app_id) | |
104 | 103 |
105 translation = load_translation(files, defaultLocale) | 104 translation = load_translation(files, defaultLocale) |
106 name_key = 'name' if release_build else 'name_devbuild' | 105 name_key = 'name' if release_build else 'name_devbuild' |
107 params['display_name'] = translation[name_key]['message'] | 106 params['display_name'] = translation[name_key]['message'] |
108 params['description'] = translation['description']['message'] | 107 params['description'] = translation['description']['message'] |
109 | 108 |
110 for size in ['44', '50', '150']: | 109 for size in ['44', '50', '150']: |
111 path = '{}/logo_{}.png'.format(ASSETS_DIR, size) | 110 path = '{}/logo_{}.png'.format(ASSETS_DIR, size) |
112 if path not in files: | 111 if path not in files: |
113 raise KeyError(path + ' is not found in files') | 112 raise KeyError(path + ' is not found in files') |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 for name, path in metadata.items('appx_assets'): | 197 for name, path in metadata.items('appx_assets'): |
199 path = os.path.join(baseDir, path) | 198 path = os.path.join(baseDir, path) |
200 files.read(path, '{}/{}'.format(ASSETS_DIR, name)) | 199 files.read(path, '{}/{}'.format(ASSETS_DIR, name)) |
201 | 200 |
202 files[MANIFEST] = create_appx_manifest(params, files, | 201 files[MANIFEST] = create_appx_manifest(params, files, |
203 buildNum, releaseBuild) | 202 buildNum, releaseBuild) |
204 files[BLOCKMAP] = create_appx_blockmap(files) | 203 files[BLOCKMAP] = create_appx_blockmap(files) |
205 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP]) | 204 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP]) |
206 | 205 |
207 files.zip(outfile, compression=zipfile.ZIP_STORED) | 206 files.zip(outfile, compression=zipfile.ZIP_STORED) |
OLD | NEW |