| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 '''Publishes a set of extensions to the webstore. | 7 '''Publishes a set of extensions to the webstore. |
| 8 Given an unpacked extension, compresses and sends to the Chrome webstore. | 8 Given an unpacked extension, compresses and sends to the Chrome webstore. |
| 9 | 9 |
| 10 Releasing to the webstore should involve the following manual steps before | 10 Releasing to the webstore should involve the following manual steps before |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 Returns: | 65 Returns: |
| 66 Temporary file with generated manifest. | 66 Temporary file with generated manifest. |
| 67 ''' | 67 ''' |
| 68 new_file = tempfile.NamedTemporaryFile(mode='w+a', bufsize=0) | 68 new_file = tempfile.NamedTemporaryFile(mode='w+a', bufsize=0) |
| 69 in_file_name = os.path.join(_SCRIPT_DIR, os.path.pardir, | 69 in_file_name = os.path.join(_SCRIPT_DIR, os.path.pardir, |
| 70 'manifest.json.jinja2') | 70 'manifest.json.jinja2') |
| 71 context = { | 71 context = { |
| 72 'is_guest_manifest': '0', | 72 'is_guest_manifest': '0', |
| 73 'is_js_compressed': '1', | 73 'is_js_compressed': '1', |
| 74 'is_webstore': '1', |
| 74 'set_version': GetVersion() | 75 'set_version': GetVersion() |
| 75 } | 76 } |
| 76 generate_manifest.processJinjaTemplate(in_file_name, new_file.name, context) | 77 generate_manifest.processJinjaTemplate(in_file_name, new_file.name, context) |
| 77 return new_file | 78 return new_file |
| 78 | 79 |
| 79 | 80 |
| 80 def RunInteractivePrompt(client_secret, output_path): | 81 def RunInteractivePrompt(client_secret, output_path): |
| 81 input = '' | 82 input = '' |
| 82 while True: | 83 while True: |
| 83 print 'u upload' | 84 print 'u upload' |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 print('Uploading...%s' % | 146 print('Uploading...%s' % |
| 146 webstore_extension_util.PostUpload(output_path.name, client_secret)) | 147 webstore_extension_util.PostUpload(output_path.name, client_secret)) |
| 147 print('publishing...%s' % | 148 print('publishing...%s' % |
| 148 webstore_extension_util.PostPublish(client_secret).read()) | 149 webstore_extension_util.PostPublish(client_secret).read()) |
| 149 else: | 150 else: |
| 150 RunInteractivePrompt(client_secret, output_path) | 151 RunInteractivePrompt(client_secret, output_path) |
| 151 | 152 |
| 152 | 153 |
| 153 if __name__ == '__main__': | 154 if __name__ == '__main__': |
| 154 main() | 155 main() |
| OLD | NEW |