| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Creates a directory with with the unpacked contents of the remoting webapp. | 6 """Creates a directory with with the unpacked contents of the remoting webapp. |
| 7 | 7 |
| 8 The directory will contain a copy-of or a link-to to all remoting webapp | 8 The directory will contain a copy-of or a link-to to all remoting webapp |
| 9 resources. This includes HTML/JS and any plugin binaries. The script also | 9 resources. This includes HTML/JS and any plugin binaries. The script also |
| 10 massages resulting files appropriately with host plugin data. Finally, | 10 massages resulting files appropriately with host plugin data. Finally, |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 files.append(s.rstrip()) | 162 files.append(s.rstrip()) |
| 163 | 163 |
| 164 # Ensure a fresh directory. | 164 # Ensure a fresh directory. |
| 165 try: | 165 try: |
| 166 shutil.rmtree(destination) | 166 shutil.rmtree(destination) |
| 167 except OSError: | 167 except OSError: |
| 168 if os.path.exists(destination): | 168 if os.path.exists(destination): |
| 169 raise | 169 raise |
| 170 else: | 170 else: |
| 171 pass | 171 pass |
| 172 os.mkdir(destination, 0775) | 172 os.makedirs(destination, 0775) |
| 173 | 173 |
| 174 if buildtype != 'Official' and buildtype != 'Release' and buildtype != 'Dev': | 174 if buildtype != 'Official' and buildtype != 'Release' and buildtype != 'Dev': |
| 175 raise Exception('Unknown buildtype: ' + buildtype) | 175 raise Exception('Unknown buildtype: ' + buildtype) |
| 176 | 176 |
| 177 jinja_context = { | 177 jinja_context = { |
| 178 'webapp_type': webapp_type, | 178 'webapp_type': webapp_type, |
| 179 'buildtype': buildtype, | 179 'buildtype': buildtype, |
| 180 } | 180 } |
| 181 | 181 |
| 182 # Copy all the files. | 182 # Copy all the files. |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 parser.add_argument('--use_gcd', choices=['0', '1'], default='0') | 458 parser.add_argument('--use_gcd', choices=['0', '1'], default='0') |
| 459 | 459 |
| 460 args = parser.parse_args() | 460 args = parser.parse_args() |
| 461 args.use_gcd = (args.use_gcd != '0') | 461 args.use_gcd = (args.use_gcd != '0') |
| 462 args.app_capabilities = set(args.app_capabilities) | 462 args.app_capabilities = set(args.app_capabilities) |
| 463 return buildWebApp(**vars(args)) | 463 return buildWebApp(**vars(args)) |
| 464 | 464 |
| 465 | 465 |
| 466 if __name__ == '__main__': | 466 if __name__ == '__main__': |
| 467 sys.exit(main()) | 467 sys.exit(main()) |
| OLD | NEW |